WordPress.org

Ready to get started?Download WordPress

Forums

Network Shared Posts
Works only for categories and posts - changed that - code submission (2 posts)

  1. rizi
    Member
    Posted 1 year ago #

    Hey,

    in network-shared-posts.php in line #149 you're binding the request to only taxonomies 'category' and 'post_tag' - but there might be more if you're working with custom post types and custom taxonomies.

    so changing that line from
    $tax_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM $TermTaxonomyTable WHERE (taxonomy = 'category' OR taxonomy = 'post_tag') AND term_id = $cat_id" ) );

    to
    $tax_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM $TermTaxonomyTable WHERE term_id = $cat_id" ) );

    works with all post-types and taxonomies :)

    rico

    http://wordpress.org/extend/plugins/network-shared-posts/

  2. Code Ext
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, rizi
    Good advice.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags