Support » Plugin: Dynamic Month & Year into Posts » The shortcode doesn’t work in WPSSO Pluigins :-(

  • Resolved MemoMx

    (@memomx)


    Hi (@gauravtiwari),

    This plugin has helped me a lot with Rankmath and I see many more people, congratulations on such a great job.
    Unfortunately for me and I suppose for those who use the WPSSO plugins for schemas, we cannot say the same since the shortcodes are not executed in Open Graph (Facebook and Twitter) fields.
    Nor in the texts of the schemes, especially in the WPSSO FAQ.

    Do you plan to include a solution for these plugins, the truth would be great to have that, it would be one less headache hehehe

    If it’s not too much trouble, could you help me for the moment to try to solve the problem?
    WPSSO has a filter page but none has worked for me, I’m not an expert, surely I’m not doing something correctly.
    https://wpsso.com/docs/plugins/wpsso/notes/developer/filters/

    Thanks in advance!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Gaurav Tiwari

    (@gauravtiwari)

    Hi @memomx , It shouldn’t be much of a work implementing Shortcode Supports in WPSSO. Allow me a couple of days to go through the plugin and I’ll update you about the progress.

    Plugin Author Gaurav Tiwari

    (@gauravtiwari)

    Hi again, @memomx. Setting up exact data will take a lot of time. Can you please send me a message via https://gauravtiwari.org/contact/ with a post link in which there’s a WPSSO FAQ content?

    Thread Starter MemoMx

    (@memomx)

    Hi @gauravtiwari
    Thank you very much now I write you with the information.

    As explained in your other post at https://wordpress.org/support/topic/using-shortcode-in-question-title-body-schema-fail/, WPSSO Core cannot apply the WordPress ‘the_title’ filter because many plugins/themes hooking this filter cannot handle multiple post titles within a singular page.

    If you need to apply shortcodes to the title, you can use the ‘wpsso_the_title’ filter instead.

    Example:

    add_filter( 'wpsso_the_title', 'do_shortcode', 10, 1 );
    

    Note that the ‘wpsso_the_title’ filter is applied to all titles – posts, terms, archive pages, etc. The second $mod argument is available to provide context on the object being filtered. See here for more info: https://wpsso.com/docs/plugins/wpsso/notes/developer/the-mod-variable/

    Since the do_shortcode() function would not understand the $mod argument, it’s important that you hook the filter with only 1 argument (which is the text being filtered).

    js.

    Plugin Author Gaurav Tiwari

    (@gauravtiwari)

    Hi @memomx , the shortcodes are getting rendered perfectly on frontend except those are getting printed as-they-are in the JSON/LD code. Looks like WPSSO is sanitizing the filters and currently there isn’t a filter to render shortcodes in FAQs.

    There is only one method to get the title, so that filter is applied to all titles, whether they are in meta tags, Schema markup, back-end, or front-end. If a shortcode is not getting resolved, make sure that shortcode is registered on the back-end as well – some plugins/theme only register their shortcodes on the front-end.

    js.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘The shortcode doesn’t work in WPSSO Pluigins :-(’ is closed to new replies.