On my Wordpress Multisite I have ACF options pages. No fields displayed

104 Views Asked by At

So I have the most recent Wordpress ~6.4 and have a Multisite set up. The template loads the ACF options page like this:

    private function __construct() {

        /** OTHER ACTIONS & FILTERS **/
    
        if ( function_exists( 'acf_add_options_page' ) ) {
            acf_add_options_page();
            acf_add_options_page( 'Admin Options' );
        }
    }

Now the "Admin Options" page works on a single instance, or if the Multisite Subsite is the first/main installed site. As soon as it is not I get this errors:

enter image description here

Meanwhile the "normal" options page, works on every single instance I have tested.

enter image description here

To my knowledge I have nothing that could interfere with the "Admin Option" page. Also, the ACF fields settings are clearly correct:

enter image description here

I set up multiple single and multisites, each of them with the same result/issue. Single sites always work. On multisites "Admin Options" always work on the main-multisite. Not on any of the subsites.

Removing all my code, except the function i have above, did not change the result. Still no "Admin Options" page fields.

1

There are 1 best solutions below

0
Frizzant On

As usual, within a short time of posting a question, the answer comes:

So turns out that Multisites in Wordpress don't just have "Administrator" but actually a "Super Admin" too. ACF does not seem to have the option to select "Super Admin", so i removed the ACF rules and refactored my code to do it via PHP like this:

    if ( function_exists( 'acf_add_options_page' ) ) {
            acf_add_options_page();

            if ( current_user_can( 'administrator' ) || current_user_can( 'superadmin' ) ) {
                acf_add_options_page( 'Admin Options' );
            }
    }