Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @alexvandervegt

    To be honest I wasn’t aware Yoast had added the json ld data, so I am actually very happy with your question ?? So to answer your question: yes there is a possibility our plugin will also output the Yoast json ld data! I will see to it that we will add it as soon as possible.

    Thread Starter alexvandervegt

    (@alexvandervegt)

    Thanks! Please give me a headsup when its done ??

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @alexvandervegt

    We just released a new version of our plugin, which now includes the json ld data. For each post/page/… you can find an array of JSON LD data in that object under yoast_json_ld.

    Please let us know if this works for you!

    Thread Starter alexvandervegt

    (@alexvandervegt)

    This is perfect!

    Since you are in fire, I have another question, I do not see the yoast meta and json ld appear for custom post types in the wp rest api?

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @alexvandervegt

    The plugin should add the yoast meta and json ld for custom post types automatically. Unless you have created a custom WP_REST_Controller for it and have not implemented the rest_prepare_POSTTYPE filter. I just did a test and did see them in a custom post type I just created.
    So if it isn’t working on your side, it is either because you have a custom WP_REST_Controller which doesn’t implement the rest_prepare_POSTTYPE filter (replace POSTTYPE with your actual post type name) or there is some caching which is serving cache from before you activated the WP REST Yoast Meta plugin. If it isn’t caused by any one of those, I am affraid I don’t know what might me causing it.

    By the way: we also just released a new version of our plugin to fix an inconsistency in the way the json ld data is parsed. We prefer DOMDocument parsing, but if that isn’t installed we try simplexml parsing instead. The two gave a different output of the json ld data, which we fixed. But depending on which is used on your server the output might have changed, so just a heads up ??

    Plugin Author Richard Korthuis

    (@rockfire)

    This thread has been marked as resolved due to lack of activity.

    You’re always welcome to open a new topic.

    Thanks for understanding!

    Thread Starter alexvandervegt

    (@alexvandervegt)

    I found the problem, your hook is excuted before mine.

    When i adjust

    add_action( ‘init’, [ $this, ‘register_rest_prepare_hooks’ ] );

    to

    add_action( ‘init’, [ $this, ‘register_rest_prepare_hooks’ ], 50 );

    Everything works as expected. Is this something you can change?

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @alexvandervegt

    Is this really the add_action for which you changed the priority? All this hook does is adding the rest_prepare_POST_TYPE filters. Are you sure you didn’t change the priority for the rest_prepare_POST_TYPE filters?

    By the way couldn’t you also solve it by changing the priority of your own hook to a priority lower than 10?

    We are willing to change the priority, but we first want to make sure we are talking about the correct hook.

    Thread Starter alexvandervegt

    (@alexvandervegt)

    Yeah ofcourse, did not thought about that.

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘json ld data’ is closed to new replies.