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

Is it possible to make it work with get_posts() #75

Open
1 task done
webdados opened this issue Mar 20, 2024 · 0 comments
Open
1 task done

Is it possible to make it work with get_posts() #75

webdados opened this issue Mar 20, 2024 · 0 comments

Comments

@webdados
Copy link

Is your enhancement related to a problem? Please describe.

First of all, thanks for sharing this.

The 'relationship_query' argument on queries currently only work for WP_Query and not for get_posts().

Is there an underlying reason for this?

While we can easily use WP_Query on our own developments, I'm now in a situation where I need to hook into other plugin queries, and manipulate them to return only related posts, and it doesn't work because at the end they+re using get_posts() an not WP_Query.

For example, I'm trying to manipulate the options on a WPForms field, by using their wpforms_dynamic_choice_post_type_args filter without success because they're using get_posts().

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@webdados webdados changed the title Make it work with get_posts() Is it possible to make it work with get_posts() Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant