Skip to content

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

Closed
@scribu

Description

@scribu

'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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions