Only thing I did is:
– acf_add_options_page with “redirect: false”
– and then “add_submenu_page()” which negates the redirect and makes it “true” basically
Why? Because I have ACF Option Page ad main where I have settings. It’s for my plugin. After that I need custom pages (mosty currently used to hide CPT my plugin creates).
So when I click on the “first” item I see Option Page but there is submenu with more subpages I need.
Correct me if I am wrong, but why should I use “acf_add_options_sub_page” to link to CPT or show custom content (not related to ACF)? This function does not support that, so I use default WordPress way
PS: I managed to have it working (add acf subpage and the main option page is redirecting to it).
I do know that it works/or does not work when mixing acf options pages with other types of admin menu items. I don’t know why you are seeing this issue when using a WP sub menu page as a sub page of an ACF options page.
This has a lot to do with the priority when adding the page or sub page. For example, due to priority of the ACF options page addition it is quite complicated to add a CPT as a sub page. It could be that there is a similar situation happening with mixing and acf options page with wp sub pages. See my explanation and fix for adding a CPT as a submenu item of an ACF options page here, it might help you. https://github.com/Hube2/acf-filters-and-functions/blob/master/acf-options-page-w-cpt-children.php
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users