-
Hello I would like to change the %crurrentmonth% from Letter to Number, How would I do it.
https://support.rankmath.com/ticket/variable-currentmonth-custom/ Also I follow the instruction from this thread and added the code however it does not seem to work when I type : %current_month_custom% nothing show up.The COde :
add_action( ‘rank_math/vars/register_extra_replacements’, ‘register_custom_rep’ );
function register_custom_rep() {
RankMath\Helper::register_var_replacement(
‘current_month_custom’,’get_current_month_custom’,
array(
‘name’ => esc_html__( ‘Current Month’, ‘rank-math’ ),
‘desc’ => esc_html__( ‘Current server month’, ‘rank-math’ ),
‘example’ => current_time( ‘F’ ),
)
);}
function get_current_month_custom() {
if ( ! isset( $replacement ) ) {
$replacement = date(‘n’);
}return $replacement;
}
You must be logged in to reply to this ticket.