Default Site titles with snippet variables not saving when post is published
-
I’m using a headless WordPress with WP-API.
So, I’m exposing yoast data in the API. With something like this:
'yoast_wpseo_title' => wpseo_replace_vars(get_post_meta($post->ID, '_yoast_wpseo_title', true), $post)
I have default SEO titles with snippet variables set for each of my post types under search apperance -> content types.
Weird thing is that if the seo title for the post is modified, it seems to save and this function returns me the correct title.
But if the default title is untouched, then the above function returns null. Moreover, if I edit the title back to the default, it also returns null.
I’m not running into this with regular WordPress sites when using standard PHP functions to directly render these fields.
- The topic ‘Default Site titles with snippet variables not saving when post is published’ is closed to new replies.