| 开发者 | runthingsdev |
|---|---|
| 更新时间 | 2026年11月16日 12:51 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv3 or later |
| 版权网址: | 版权信息 |
[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
[year][year from="2020"][year from="2020" mode="short"], which shows "2020-26" (if the current year is 2026)[runthings_year] if another plugin already uses the 'year' shortcoderunthings_current_year_shortcode_tag) to set your own shortcode[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)/wp-content/plugins/runthings-current-year-shortcode directory, or install the plugin through the WordPress plugins screen directly.[year] shortcode in your posts, pages, or widgets.If another plugin already uses the [year] shortcode, this plugin will automatically use [runthings_year] instead to avoid conflicts.
On the Plugins admin page, you'll see the active shortcode listed in the plugin's row.
Yes! This shortcode works perfectly in footer widgets, custom footer code, or anywhere else shortcodes are supported in your theme.
When using a date range with years in the same century (e.g., 2020-2026), the 'short' mode will abbreviate the end year to just the last digits (2020-26), creating a cleaner look for your copyright statements.
runthings_current_year_shortcode_tag filter to customise the shortcode