WordPress.org

Ready to get started?Download WordPress

Forums

Open Graph
Remove [shortcodes] and (5 posts)

  1. Philipp
    Member
    Posted 1 year ago #

    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/

  2. Philipp
    Member
    Posted 1 year ago #

    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!

  3. Will Norris
    Member
    Plugin Author

    Posted 1 year ago #

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

  4. Philipp
    Member
    Posted 1 year ago #

    Thanks Will! I'll check it out! :)

  5. SLiX
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.