Keep date time related texts relevant. "I have worked for x years." becomes outdated within a year. Years since keeps "x" current in your posts and allow your content to age well.
A year must be provided in your text by the attribute "y" such as [years-since y=2012].
As an option, Months by referencing "m" and day by using "d". Months and day default to "1" if not added in the shortcode.
For example, on an "About" page text, you might have something like:
We've worked remotely for
[years-since y=2012], which has allowed the team to spend more time traveling and spending time with family. Or, if you wanted to update a time span on a particular anniversary, you could do something like:I'm [years-since y=1990 m=5 d=16] old.
[y=2000 m=1 d=1 show='y'] will output 24 years only skipping the month and day.
[y=2000 m=1 d=1 show='ym'] will output 24 years 1 month only skipping the day.
Add specific HTML to the calculation with the html attribute, e.g.
[years-since y=1990 html=span] will wrap the output in a span tag.
Add a text attribute with value false i.e.
[years-since y=1990 text=false] will remove the text years from the calculation. It will output 23 instead of 23 years.
- Navigate to your plugins admin page.
- Search for "years since" and download the plugin.
- Install using the plugin admin interface.
Yes.
Yes. This will still work even if you revert back to the Classic Editor seamlessly.
You can raise lots of issues here and also make some Pull Requests through github
- Add: Show attribute to display only the year / year & month with the full date added.
- Streamline the HTML Output basing on the allowed tags.
- Add new attribute check.
- Fix: Add proper escaping for the shortcode input.
- Fix: Breaking month and day output.
- Add: Testing for WP 6.5.2
- Add: Require PHP 8.2.0
- Add: Require PHP 7.4
- Add: Function arguments and Return Type hinting.
- Add: Testing framework with pest with CI.
- Fix: Deprecate Editor poylfill function for the block editor.
- Fix: Breaking change HTML Default argument paragraph
htmlattribute as "p" for the shortcode output.
- Fix: Restore minus text format for the calculations.
- Add: Translations file build + .pot
- Add: Default attributes for the shortcode.
- New: HTML Default argument paragraph
htmlattribute as "p" for the shortcode output.
- Fix: Time calculations and messaging.
- Test: WP 6.3.1.
- Test: PHP 8.2.10.
- Fix
orto||
- Namespace the plugin to avoid PHP conflicts.
- Fix the breaking html when [years-since-gb] is used.
- Test WP version compatibility for 5.6.
- Add functionality to allow for days, months, weeks instead of 0 years when time is less than a year.
- Add Gutenberg support
- Add Gutenberg note to readme.
- Translate returned errors.
- Shortcode parameter to suppress "year" and "years" text.
- Initial creation.

