WordPress.org

Ready to get started?Download WordPress

Forums

FeedWordPress
[resolved] Feedwordpress and Jetpack Publicize: Use syndicated links for social media posti (3 posts)

  1. Sascha Foerster
    Member
    Posted 5 months ago #

    How can I change Jetpack to use the syndicated link from Feedwordpress for social media postings instead of the permalinks linking to the website itself?
    I tried to change it with a adapted plugin, but then all my posts get duplicated:

    /**
     * Init plugin
     */
    function UsePermalinks_init()
    {
    	add_filter( 'get_shortlink', 'UsePermalinks_get_shortlink' );
    }
    add_action( 'init', 'UsePermalinks_init');
    
    /**
     * Return the permalink instead of the ugly ugly shortlink
     */
    function UsePermalinks_get_shortlink()
    {
    	global $post;
    
    	if ( !$post )
    		return;
    
    	return the_syndication_permalink($post->ID);
    }
    
    ?>

    https://wordpress.org/plugins/feedwordpress/

  2. Sascha Foerster
    Member
    Posted 5 months ago #

    To change the behavior of publicize, I used this code in functions.php and it worked:

    function fwp_jetpack_shortlink($syndication_permalink) {
        $short_link = get_syndication_permalink($ID);
        if('' == $short_link) return false;
        return $short_link;
    }
    add_filter('get_shortlink','fwp_jetpack_shortlink');
    ?>

    The problem with duplicates is still persisting.

  3. Sascha Foerster
    Member
    Posted 5 months ago #

Reply

You must log in to post.

About this Plugin

About this Topic