WordPress.org

Support

Support » Plugins and Hacks » exclude connected to

exclude connected to

  • aaron@rossano.com.au
    Participant

    @aaronrossanocomau

    hi,
    is it possible to exclude an array of IDs from a query with a filter for a relationship?
    so for example i’ll get all the posts which are not related to these pages ids array?

    here’s an example:
    $pagesids = array(1,2,3,4);

    $args = array(
    	'post_type' => 'post',
    	'post_status' => 'publish',
    );
    
    $args['connected_type'] = array( 'post_to_page' );
    $args['connected_direction'] = 'to';
    $args['connected_to'] = $pagesids; // instead of using connected_to i would use not_connected_to
    
    $query = new WP_Query( $args );

    http://wordpress.org/plugins/posts-to-posts/

  • The topic ‘exclude connected to’ is closed to new replies.