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
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!
© 2022 Advanced Custom Fields.