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

Cannot query connected posts in ajax call #582

Open
THRY opened this issue Feb 4, 2024 · 0 comments
Open

Cannot query connected posts in ajax call #582

THRY opened this issue Feb 4, 2024 · 0 comments

Comments

@THRY
Copy link

THRY commented Feb 4, 2024

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?

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