Home › Forums › Backend Issues (wp-admin) › How Do I Further Constrain a "Filter by Post Type" Result Set › Reply To: How Do I Further Constrain a "Filter by Post Type" Result Set
Is there some reason that you need to select from a list of products on the manufacturer field?
For example, there are 10 products related to the manufacturer but you only want to select 5 of them.
Or do you want to be able to have all of the products related to the manufacturer selected in the relationship field?
If it is the second, that is all of the products are selected that are related to the manufacturer, the I would use https://wordpress.org/plugins/post-2-post-for-acf/, this plugin handles one to many relationships.
If it is the first then you need to create an acf/fields/relationship/query filter. In this filter you need to do a query to get all of the products related to the current manufacturer. Then you use the return or this query to set the “post__in” argument for the query that ACF will do to get the list of posts to display in the relationship field.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future.— Advanced Custom Fields (@wp_acf) January 6, 2023
© 2023 Advanced Custom Fields.