Simple WordPress shortcode to automatically display the current year anywhere on your website. This shortcode is useful for dynamic copyright text, footers, and content sections without manually updating the year every time.
function current_year_shortcode() {
return date('Y');
}
add_shortcode('current_year', 'current_year_shortcode');