-
add_action( 'rank_math/vars/register_extra_replacements', function(){
rank_math_register_var_replacement(
'filtered_meta_description',
[
'name' => esc_html__( 'Filtered META description', 'rank-math' ),
'description' => esc_html__( 'Generated META description when using shortcodes.', 'rank-math' ),
'variable' => 'filtered_meta_description',
'example' => 'Example META description...',
],
'rankmath_filtered_meta_description()'
);
});function rankmath_filtered_meta_description() {
return 'foobar';
}Does not output “foobar” in category description when using %filtered_meta_description%
The ticket ‘rank_math_register_var_replacement doesn’t work’ is closed to new replies.