Open THRY opened 4 months ago
Hi
I am trying to query connected posts in an ajax call in wp-admin. While i can query normally for posts with get_posts, the p2p query is always empty:
get_posts
$students = get_posts(array( 'connected_type' => 'booking_to_student', 'connected_items' => get_post($bookingId), 'post_status' => 'any', 'nopaging' => true, 'suppress_filters' => false ));
When i run this code in a page template, i do get the expected result.
Updating relationships work perfectly in ajax call.
Any hints on that? Maybe an issue with execution time?
Hi
I am trying to query connected posts in an ajax call in wp-admin. While i can query normally for posts with
get_posts
, the p2p query is always empty:$students = get_posts(array( 'connected_type' => 'booking_to_student', 'connected_items' => get_post($bookingId), 'post_status' => 'any', 'nopaging' => true, 'suppress_filters' => false
));
When i run this code in a page template, i do get the expected result.
Updating relationships work perfectly in ajax call.
Any hints on that? Maybe an issue with execution time?