-
I follow this post: https://support.rankmath.com/ticket/display-short-form-of-months-instead-of-long-form-jan-and-not-january/ to Display a short form of Months.
/**
* A custom replacement variable to get the current month in custom format
*/add_action( 'rank_math/vars/register_extra_replacements', function(){
rank_math_register_var_replacement(
'current_month_M',
[
'name' => esc_html__( 'Current month', 'rank-math' ),
'description' => esc_html__( 'Current server time displaying month in custom format', 'rank-math' ),
'variable' => 'current_month_M',
'example' => custom_date_callback(),
],
'custom_date_callback()'
);
});function custom_date_callback(){
return date_i18n( 'M' );
}
After active snippet show this: There has been a critical error on this website. show this error only when I use this short code
current_month_M
Check this: https://tinyurl.com/yzt4z8yk
Please solve this issue ASAP!
Thanks
The ticket ‘Display short form of Months instead of long form’ is closed to new replies.