Hello,
Thank you for contacting the support, and sorry for any inconvenience that might have been caused due to that.
I’m not quite sure whether I fully understand the question. But I’ll do my best and please let me know if I misunderstood.
Are you referring to a custom field created by your theme and use it as a variable for the post’s schema data? If this is the case, you can make use of this filter to create a custom variable and assign a field to it:
/**
* Action: 'rank_math/vars/register_extra_replacements' - Allows adding extra variables.
* Snippet to register variable that will return all terms in custom taxonomy
*/
add_action( 'rank_math/vars/register_extra_replacements', function(){
rank_math_register_var_replacement(
'shortcode_var_name', [
'name' => esc_html__( 'Author name', 'rank-math' ),
'description' => esc_html__( 'Author description', 'rank-math' ),
'variable' => 'shortcode_var_name', /* the actual variable: %shortcode_var_name% */
'example' => shortcode_var_name_call_back(),
],
'shortcode_var_name_call_back'
);
});
function shortcode_var_name_call_back(){
global $post;
return get_field('my_field_name', $post->ID);
}
If it still seems I am missing something, please explain more of your goal in detail or share additional examples so we can further understand and gave you more solutions.
We are looking forward to helping you with this one.
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.