Current Year Shortcode
This is a plugin which adds a simple shortcode to display the current year or a dynamic year range, particularly useful for copyright statements at the bottom of your website. Its most basic usage is [year] , which will display the current year. If you provide a starting year with the ‘from’ paramet
This is a plugin which adds a simple shortcode to display the current year or a dynamic year range, particularly useful for copyright statements at the bottom of your website.
Its most basic usage is [year] , which will display the current year. If you provide a starting year with the ‘from’ parameter, it will expand into a date range when the ‘from’ year is before the current year.
If [year] is used by another plugin, then it uses the fallback [runthings_year] which can be customised with the runthings_current_year_shortcode_tag filter. You can see the active shortcode tag in it entry in the installed plugins page.
Features
- Display current year with [year]
- Create a dynamic year range with [year from="2020"]
- Abbreviated year format with [year from="2020" mode="short"] , which shows “2020-26” (if the current year is 2026)
- Automatic fallback shortcode [runthings_year] if another plugin already uses the ‘year’ shortcode
- Filter ( runthings_current_year_shortcode_tag ) to set your own shortcode
Usage Examples
Assuming the current year is 2026:
- [year] displays “2026”
- [year from="2026"] displays “2026” (since it’s the current year)
- [year from="1983"] displays “1983-2026”
- [year from="2020" mode="short"] displays “2020-26” (shortened current year)
- [year from="1995" mode="short"] displays “1995-2026” (not shortened because centuries differ)
Filters
runthings_current_year_shortcode_tag
This filter allows customization of the shortcode tag used by the plugin.
For detailed documentation and examples, see the full documentation on GitHub .
Parameters:
- 01$tag ( string ): The shortcode tag to be registered. Defaults to ‘year’ or ‘runthings_year’ if conflicted.
Additional Notes
Built by Matthew Harris of runthings.dev, copyright 2021-2026.