• Resolved koganas

    (@koganas)


    I’m updating the plugin in a WordPress project from version 4.2.8 to 5.0.6. After some significant changes on version 5, I was unable to find details in the documentation, so I opened this topic.

    I used get_ld_json_website() and get_ld_json_links() in the project, but it has been removed after v5. What methods can I use in place, and where can I find better documentation about it since The_SEO_Framework\Generate_LDJson was dropped from the plugin?

    • This topic was modified 5 months ago by koganas.
Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    TSF v5.0 overhauled many things, including a brand new Schema.org structured data generator.

    The old code for the structured data is at extreme odds with the new generator. I deleted the old functions because I couldn’t match them with the new generator; at best, they created a large chain of deprecated calls.

    I’m not sure why you implemented these deleted functions; they were part of the standard TSF renderer and outputted the HTML script containers as a whole. But I think you could use tsf()->filter()->escape()->json_encode_script( tsf()->schema()->get_generated_graph() ) to get the entire Schema.org graph formatted and wrap that in a <script type=application/ld+json> element.

    Please note that tsf()->filter()->escape()->json_encode_script() already escapes; double escaping JSON will cause rendering errors.

    If you would like me to give a more concrete answer that might be more secure in your scenario, please show me the old code. Thank you!

    • This reply was modified 4 months, 4 weeks ago by Sybre Waaijer. Reason: more info
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.