• Resolved fightthecurrent

    (@fightthecurrent)


    Is it possible to get all posts connected to a user, regardless of connection type? right now I’m using a custom sql query and then feeding the user id’s into a WP_Query. Here’s the sql:

    select * from $wpdb->p2p where p2p_to = $user_ID

    Namely I’m just curious if there’s a built in way with P2P to do it. This works great for what I need, but we’re also using the P2P WPML plugin, so I’d like to keep it in the system if at all possible.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author scribu

    (@scribu)

    No, and that’s intentional. You can, however, specify multiple connection types:

    $posts = get_posts( array(
      'connection_type' => array( 'user_favorites', 'another_connection_type' ),
      'connected_items' => $some_user_id_or_object,
      'nopaging' => true,
      'suppress_filters' => false
    ) );
    Thread Starter fightthecurrent

    (@fightthecurrent)

    You’re awesome.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get all posts connected to a user?’ is closed to new replies.