Alternatively, you could use WP CLI to do this, if it suits your workflow:
wp eval 'acf_pro_update_license("YOUR_KEY_HERE");'
It’s been so long since I did this, I can’t recall where I used it. But, if you hook into that filter and dump out whatever is passed into it, you’ll be able to analyse the data structure and unset
anything you don’t need in a given context.
Hope that helps.
Just thought I would add to this as I have experienced the same issue.
I use the flexi field for a similar functionality and have a lot of sub fields with conditional logic. The lag became quite high after a few fields had been added to the page and I found that the main culprit was a post link field inside repeater rows. I disabled that and the conditional logic and everything was smooth again. This was developing locally as well.
Thanks @elliot
That definitely did the trick. Both filters and their respective techniques (reordering fields or modifying the hide_on_screen array) work just fine. I opted to use the acf/field_group/get_options
filter though, along with some conditional checks for the relevant page/post/template to achieve the desired result.
By using this technique, we don’t really have to worry about setting display options when configuring the field, as we can control the settings on a post/page/template basis instead.
Awesome.
Cheers
Just an FYI, @elliot, in case you decide to throw the hook in sometime soon, the perfect place for it would be in the html() function in acf-options-page.php on line 480 (by my IDE). It would be just above the form#post opening tag.
That would make it possible to drop in the following snippet;
<h2 class="nav-tab-wrapper">
<a href="#" class="nav-tab">Display Options</a>
<a href="#" class="nav-tab">Social Options</a>
</h2>
I reckon that would be almost perfect for what I’m on about, although it would still only be dropping the tabs underneath the heading (but that is heaps closer to what I’m after, anyhow).
I would also be awesome if we could create more than one top level ACF options page, as there would be no need to manually create one, as I already have, resulting in a mostly empty page with a few buttons on it… unless I missed something and we can already do so. It wouldn’t surprise me 😀
Cheers!
Phil
Hi @elliot
It’s kind of what I have resorted to. I went and created a new top level admin page and added the ACF subpages to that.
If there was a hook at the top of the page, I could actually hook the tabs markup in there and have them behaving as though they were a tabbed group of pages. The markup can simply be copied across from themes.php.
I also noticed that I can assign the ACF subpages’ parent property to that of a page that is already a second level menu item. e.g. Widgets.php, or even a page that doesn’t exist such as adfasfdgsdfgsdfg.php. This seems like a great way to hide the pages if you don’t want them appearing in the menu. This would be perfect for usage with the tabs, if only there were a hook 😉
Maybe in a future version?
Cheers
Phil
Thanks @elliot
I think the best approach would be to enable ACF custom fields to be hooked. If that were possible, the WP admin page could then be constructed manually, using WP functions, but the developer could add in their own hooks, thereby allowing them to hook ACF fields into their own admin page.
I created a feature request post earlier this morning for you, so if you ever get around to that, I certainly look forward to it.
Cheers
Phil
Sure can.
I’m referring to the tabs you see in Appearance > Themes. I’ve attached a screenshot for your reference.
I’m hoping to add the same tabs, maybe in the Widgets page, so that I can include my custom settings.
I’m creating a system whereby the site owner can create as many sidebars as they like and then assign them to areas of their site. So far, everything is gold, I’m just trying to organise the admin a little better.
Thanks @elliot
Morning @elliot
Thanks for that. It’s always something so simple and basic that gets me, but you learn something every day.
Cheers
Phil
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.