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

    (@scribu)

    get_related() is implemented using two calls to get_connected():

    public function get_related( $item, $extra_qv = array(), $output = 'raw' ) {
    	$extra_qv['fields'] = 'ids';
    
    	$connected = $this->get_connected( $item, $extra_qv, 'abstract' );
    
    	$additional_qv = array( 'p2p:exclude' => _p2p_normalize( $item ) );
    
    	return $this->flip_direction()->get_connected( $connected->items, $additional_qv, $output );
    }

    As you can see, the extra query vars are passed to the first query, but not to the second, but it’s pretty easy to implement your own version.

    Thread Starter Marlon Amâncio

    (@marlonlamancio)

    I had noticed this, but I thought there was another way.

    Thanks for your attention!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Posts 2 Posts] Pass query parameters to get_related()’ is closed to new replies.