Support

Account

Home Forums Feature Requests Relational Fields – filter by parent and template

Solving

Relational Fields – filter by parent and template

  • When I used one of the relational fields, such as Relationship, Post Object or Page Link, I’m normally trying to link a post to a specific other set of posts.

    For example, consider that I have a page named Events, with a few children. For whatever reason I’ve decided not to make this a custom post type.

    I have another page named Speakers, with children. I want to be able to select one or more child pages of Speakers to each child under Events.

    ACF’s Location settings allow me to specify that my Relationship field will only show on children of Events… but how do I limit what shows in that box to only children of Speakers?

    It would be really helpful to have a “Child of X” and possibly “Child of page with template X” filters alongside the normal Taxonomy filters when creating a relationship field.

  • I’m not the developer, so I can’t give a yes or a no here, but I will mark this for the developer’s attention.

    While I can understand why you want this, I can say that this is not likely to happen. But it is possible to create your own filters that modify what is returned for these fields. Some of the hooks are documented on the site and there are some undocumented hooks as well that take a little digging. For example if you open up the file /fields/relationship.php in the plugin folder you’ll find hooks that can be used to alter what is returned. I don’t remember if these are documented on the site.

  • Thanks John, I’ll take a look and see if there’s something non-intrusive I could do to add this functionality soon as I get a mo.

    I think I can see why it’s not likely to get added, but if I can add what I need I’m happy either way.

    Cheers,

  • Over time I’ve come to understand a bit of the way the developer thinks. I can also see uses for what you want, but it’s not something that would be considered a standard use. Luckily the developer has added plenty of hooks that allow us to make changes like this, it’s just that sometimes you need to find them.

    There’s a site somewhere that actually documents hooks in plugins, I don’t think they list ACF Pro here http://hookr.io/.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Relational Fields – filter by parent and template’ is closed to new replies.