Posts 2 Posts: query connected — orderby problem
-
31-10-2019 - |
Pergunta
Using Posts 2 Posts plugin I've created 'piece'
, 'person'
and 'collection'
custom post types: any piece may be connected to person (with roles 'author'
, 'conductor'
etc) and collection.
Now the relevant code looks like this:
// get all audio pieces connected to current $person:
$audio_ascond = p2p_type( 'pieces_persons' )->get_connected( $person->ID,
array( 'connected_meta' => array( 'role' => 'conductor' ),
'media_tag' => 'audio_tag',
'posts_per_page' => -1 ) );
// get their IDs:
$audio_ascond_IDs = array_map( create_function( '$p', 'return $p->ID;' ),
$audio_ascond->posts );
// get collections for those pieces:
$colls = p2p_type( 'pieces_collections' )->get_connected( $audio_ascond_IDs,
array( 'orderby' => 'menu_order title', 'posts_per_page' => -1 ) );
So, the problem is that 'orderby'
has no any effect. Everything else works great. print_r($colls)
looks like ok.
What this could be, please?
Thanks!
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a wordpress.stackexchange