You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contrary to the suggestion in the documentation, the connections don't appear to work correctly when an array of connection types is given as parameter for the query. In my case both connection queries work correctly when given individually (two connections involving custom post types), but when given jointly as an array, the quey fails to output the respective connected posts - it does still count them directly though (as per dumped output).
As mentioned when using either 'a_to_o' or 'v_to_o' sepearately as queried connection type, this works as expected. Using the above array, it does not.
The text was updated successfully, but these errors were encountered:
Contrary to the suggestion in the documentation, the connections don't appear to work correctly when an array of connection types is given as parameter for the query. In my case both connection queries work correctly when given individually (two connections involving custom post types), but when given jointly as an array, the quey fails to output the respective connected posts - it does still count them directly though (as per dumped output).
Registered as:
p2p_register_connection_type( array( 'name' => 'a_to_o', 'from' => 'a', 'to' => 'o', 'reciprocal' => true ) );
p2p_register_connection_type( array( 'name' => 'v_to_o', 'from' => 'v', 'to' => 'o', 'reciprocal' => true ) );
and queried as follows:
$connected = new WP_Query ( array( 'connected_type' => array( 'a_to_o', 'v_to_o' ), 'connected_items' => get_queried_object(), 'nopaging' => true, ) );
As mentioned when using either 'a_to_o' or 'v_to_o' sepearately as queried connection type, this works as expected. Using the above array, it does not.
The text was updated successfully, but these errors were encountered: