Skip to main content
FolksSpeakersPluginsThemesEventsSnippetsShippedCommunityResources
Login Join
Snippet · PHP

Add Current Year Shortcode

Shared by Yusuf mudagal · May 3, 2026 · @add_shortcode

2 views
Back to Snippets

Outputs the current site-local year for copyright lines, reusable blocks, and footer templates.

add_shortcode( 'current_year', 'wpfolks_current_year_shortcode' );

function wpfolks_current_year_shortcode() {
    return esc_html( wp_date( 'Y' ) );
}