Home › Forums › Feature Requests › Parent post or page
I am working on a project in which I need a field which displays the page selection, but needs to limit the displaying page by a parent page.
It means I want a field where I can select the parent-page (or any post) to limit the pages as child of it.
It will appreciable if some more options can be added to the existing Relational fields. Like, after selecting the post type in field it add another new option to select page parent post or add a new field, to pass custom get_post arguments to filter posts.
Hi @cyberwani
If you are using the relationship field, you will be happy to know there is a WP filter available to modify the query args.
You could use the current $post_ID parameter to modify the question to only load posts which have a parent of $post_ID
The filter is documented here:
http://www.advancedcustomfields.com/resources/filters/acf-fields-relationship-query/
filter the list of pages that users can select from by parent – this was exactly the feature I was going to request too!
I understand @elliot you’ve indicated how this could be done, but a way to do this through the UI would be lovely.
Hi @charlie
Thanks for the feedback. I’ll have a think about how I can add in a simple UI to customize the WP_Query args.
Thanks
E
Hi all, i’m not sure but i think i’m looking for the same thing.
In a flexible content area the user can select a page that is a parent.
– they are only shown a list of pages that are a parent.
Then for the actual content they select a page (using post object).
– they are only shown pages that are children of the parent they chose.
is this possible? the filter you linked to seems to require me to specify the parent pages form the outset & they might add more.
as always, thanks for the amazing product – and the new version rocks too!
The topic ‘Parent post or page’ is closed to new replies.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.