• Resolved Jules Colle

    (@jules-colle)


    Hi, I have tested the plugin for multisite, and out of the box everything is working fine. There’s one easy-to-fix issue I found.

    On a multisite network it seems like my theme’s functions.php file is executed AFTER the plugin script.

    So adding a filter like this won’t work:

    
    add_filter('use_admin_password_supported_roles', function($array){
        $array[80][] = 'custom-admin-role';
        return $array;
    });
    

    A workaround that seems to work fine, is to change the last line of your plugin script to:

    
    add_action('init', function(){
    	$simba_use_admin_password = new Simba_Use_Admin_Password;
    });
    

    so your script runs a little bit later (after my theme functions have loaded)

    Please let me know if you plan to add this in the next update (otherwise I’ll fork the plugin and manage my own version)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Anderson / Team Updraft

    (@davidanderson)

    Hi Jules,

    I would recommend against putting anything in your theme’s functions.php file that is not related directly to the theme. For one thing, you’ll then lose plugin functionality if you change theme; for another, as you remark, that file isn’t executed early enough.

    The proper place to put plugin customisations is in an mu-plugin. i.e. Create the folder wp-content/mu-plugins, and create a .php file in there.

    David

    Thread Starter Jules Colle

    (@jules-colle)

    Hi David, fair point. Will do that. Although I like to have all my code in a single root folder. I find it a bit easier to maintain for versioning and the likes, but there are work-arounds for that too.

    Anyway, thanks for the fast reply!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Fix for multisite’ is closed to new replies.