Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'each_connected:key' => array( ... ) #156

Closed
scribu opened this issue Apr 28, 2012 · 1 comment
Closed

'each_connected:key' => array( ... ) #156

scribu opened this issue Apr 28, 2012 · 1 comment

Comments

@scribu
Copy link
Owner

scribu commented Apr 28, 2012

'each_connected' was implemented in older versions, but was removed in favor of p2p_type( ... )->each_connected().

Since we can now query multiple connection types, each_connected() has become inadequate.

Here is a new proposed syntax:

<?php

$movies = new WP_Query( array(
    'post_type' => 'movie',

    'each_connected:actors' => array(
        'connected_type' => 'actors_to_movies',
        'genre' => 'comedy',
    )

    'each_connected:studios' => array(
        'connected_type' => 'movies_to_studios',
    )
) );

The drawbacks are the same as in the previous incarnation:

  • can't be used on the main WP_Query instance
  • harder to debug
@scribu
Copy link
Owner Author

scribu commented Apr 12, 2013

Going to go with less magic: #348.

@scribu scribu closed this as completed Apr 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant