Hello,
Thank you for contacting the support.
You will have to register custom variables to achieve that. This filter is used to register a custom variable: https://rankmath.com/kb/filters-hooks-api-developer/#add-extra-variables
Below is an example that registers a variable %get_current_date% which returns the current date:
add_action( 'rank_math/vars/register_extra_replacements', function(){
rank_math_register_var_replacement(
'get_current_date',
[
'name' => esc_html__( 'Current Date', 'rank-math' ),
'description' => esc_html__( 'Gets current date.', 'rank-math' ),
'variable' => 'get_current_date',
'example' => 'get_current_date_callback()',
],
'get_current_date_callback'
);
});
function get_current_date_callback(){
$date = date("j F Y");
return $date;
}
You will need to fetch your variables var_counrty and var_championship in the callback function and return their values.
Here’s a guide you can follow to add the filter:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Once the variables would be registered, you would be able to use them in the title/description fields.
Hope that helps.
Thank you.
Thanks a lot for the quick reply.
I will try it and get back asap.
Hello,
Sure, let us know how this goes.
Meanwhile, please don’t hesitate to contact us anytime if you have other questions to assist you further.
Looking forward to helping you.
Thank you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.