add_shortcode( 'current_year', 'mw_current_year' );
function mw_current_year() {
ob_start();
echo date('Y');
return ob_get_clean();
}
Shortcode
[current_year]
2023
add_shortcode( 'current_year', 'mw_current_year' );
function mw_current_year() {
ob_start();
echo date('Y');
return ob_get_clean();
}
Shortcode
[current_year]
2023