Support » Plugin: Open Graph » Remove [shortcodes] and

  • Philipp

    (@philippmuenchen)


    Hi Will,

    first of all thank you for this very useful Plugin. I was searching for one which is easy to use on multiple blogs within a WordPress Multisite installation. I love it!

    There’s just one problem I can’t fix by myself.
    A lot of og:description contain shortcodes as [gallery link="file"] or HTML code as <p>,</ br>, …

    I looked in the code and as I see there seems to be a filter for this strip_tags(strip_shortcodes( xyz ) but for me it filters nothing!

    It would be great if you could give me a hint how to fix that.

    Thanks

    Philipp

    http://wordpress.org/extend/plugins/opengraph/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Philipp

    (@philippmuenchen)

    OK… It’s me again! 😉

    I saw that I had this function outside your Plugin:

    `
    #—————————————————————–
    # Open Graph Anpassung
    #—————————————————————–
    function mytheme_opengraph_description($desc){
    global $post;
    if ( is_single() )
    $desc = $post->post_content;

    return $desc;
    }
    add_filter(‘opengraph_description’, ‘mytheme_opengraph_description’ );

    I removed it and the [shortcodes] are filtert now. But I still get HTML tags as: <a href="http://kulturweit-blog.de/leave/2012/10/25/moving-to-new-york-cos-ive-got-problems-with-my-sleep/">Weiterlesen <span class="meta-nav">→</span></a>

    Thank you!

    Plugin Author Will Norris

    (@willnorris)

    I just released v1.5 which does a better job of stripping both shortcodes and tags. See if that works better for you

    Philipp

    (@philippmuenchen)

    Thanks Will! I’ll check it out! 🙂

    Hi,

    I tried version 1.5 of your plugin, but there were shortcodes in description. To fix it, I replaced line 219:

    $description = strip_tags(strip_shortcodes($post->post_content));

    with:

    $description = strip_tags(strip_shortcodes(apply_filters('the_content', $post->pos t_content))

    Thanks you,
    Regards,
    SLiX.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove [shortcodes] and’ is closed to new replies.