• When syndicating posts to Facebook through an RSS syndicator, I’ve noticed that the descriptions for my posts are nothing more than jiberish. The result of putting my KGVID video at the beginning of a post.

    I’ve resolved the issue by adding this to my functions.php

    function removeKGVIDRSS($content) {
    global $post;
    if (shortcode_exists ( 'KGVID' ) ){
    $content = remove_shortcode( 'KGVID', $content) ;
    }
    return preg_replace( '/\[[^\]]+.+]/', '' , $content, -1);
    }
    
    add_filter('the_excerpt_rss', 'removeKGVIDRSS');
    add_filter('the_content_feed', 'removeKGVIDRSS');

    What it does is keep the kgvid shortcode from executing in the feed, then using a preg_replace, removes the code and its contents altogether from the feed while leaving the posts on the site intact.

    I just wanted to share this in case anyone else has this problem.

    https://www.ads-software.com/plugins/video-embed-thumbnail-generator/

Viewing 1 replies (of 1 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    Thanks Anthony, I didn’t know the shortcode was executing inside the feed description. There doesn’t seem to be any case where that would be a good idea. In the next version (probably v4.2.8) the shortcode will check if is_feed() and will return an empty string if it is.

Viewing 1 replies (of 1 total)
  • The topic ‘KGVID embed code registering as the description field on Facebook’ is closed to new replies.