Thanks I opened a ticket yesterday and already got an answer.
@hube2 I debated opening a ticket but I thought it’d be more helpful for other useres to be able to search for it on the forum. I’ll open a ticket now though, thanks.
Hey @magnakai On my version of ACF5 you can add a “Page Type is equal to Front Page” rule. Is this not available for you?
+1 I’m migrating to Bedrock at the moment and would love this
So cleeearrrly didn’t look hard enough before posting the above comment because I just saw the “Filers > Post Type Select” checkbox and realized that it mostly solves my problem.
However! It would be great if that post type select element was generated by one of the Post Type’s human-readable $label keys instead of the db post type name (I think I saw this suggestion elsewhere in the support section). I could probably hack the plugin files to do that but I’d rather not put a bunch of mediocre code into the well-oiled ACF core.
cheers
I’d also love to see this feature. Is it incorporated into the v5 public beta yet?
+1 on baking this into a future release!
hey @sKuijers, this is exactly the question I’ve been trying to answer for a few hours! Have you made any progress?
Based on what I know at this point, my approach is to
1. Register my field groups.
2. Before rendering my settings page call
do_action('acf/input/admin_head');
do_action('acf/input/admin_enqueue_scripts');
3. Add a tag in my settings page template that renders the field.
The main conceptual block I’ve run into is how I should pass the “location” params in the register_field_group() call so it reference my settings page. The plugin slug I’m using is “es_awp” (i.e. the settings URL is `http://path.to.wordpress/wp-admin/options-general.php?page=es_awp’ so I figured I could do something like this (not sure it works):
'location' => array (
array (
array (
'param' => 'page',
'operator' => '==',
'value' => 'es_awp',
'order_no' => 0,
'group_no' => 0,
),
),
),
I’d love to hear your approach and see any code examples if you have. I’ll be sure to post my code if I figure it out too.
Thanks in advance for any help!
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.