Linux 软件免费装

Texlab Current Year

开发者 texlab
更新时间 2026年9月12日 13:20
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

shortcode date copyright year current year

下载

1.1.0 1.2.0

详情介绍:

Texlab Current Year is a lightweight WordPress plugin that allows you to display the current year anywhere on your website using a simple shortcode. This is particularly useful for copyright notices and other date-sensitive content that needs to be automatically updated each year. The year is calculated from the timezone configured in Settings > General, so it rolls over at midnight for your site rather than for the server. Features Usage Simply insert the shortcode [texlab_current_year] anywhere in your posts, pages, or widgets where you want the current year to appear. Example usage in a copyright notice: © [texlab_current_year] Your Company Name. All rights reserved. Developers The rendered year can be adjusted with the texlab_current_year filter: add_filter( 'texlab_current_year', function ( $year ) { return $year; } ); GitHub repository: Texlab Current Year on GitHub

安装:

  1. Upload the plugin files to the /wp-content/plugins/texlab-current-year directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. Use the shortcode [texlab_current_year] in your content

升级注意事项:

1.2.0 Compatibility update for WordPress 7.1 plus code hardening and cleanup. The year now follows your site's timezone. Requires WordPress 6.5 and PHP 7.4 or later. 1.1.0 This version includes improved code structure and security enhancements. Update recommended for all users.

常见问题:

How do I use this plugin?

Simply insert the shortcode [texlab_current_year] wherever you want the current year to appear.

Does this plugin slow down my website?

No. The plugin registers a single shortcode and loads no scripts, styles or settings. It performs no database queries.

Can I use this in my theme's template files?

Yes, you can use the shortcode in template files by using the do_shortcode() function: <?php echo do_shortcode('[texlab_current_year]'); ?>

Which timezone is the year based on?

The year is generated with wp_date(), which uses the timezone set in Settings > General.

Does it support different date formats?

No. The shortcode outputs the year in YYYY format only. Developers who need something else can use the texlab_current_year filter.

更新日志:

1.2.0 1.1.0 1.0.0