WPIntell

Source evidence

Fix for multisite

Use Administrator Password · support · 2021-02-04T17:44:00+00:00

mixedsentiment
mediumseverity
0.78relevance
2replies
Evidence onlycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 1 rows with source links

100.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

0 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Jules Colle resolved
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) This topic was modified 5 years, 3 months ago by Jules Colle . This topic was modified 5 years, 3 months ago by Jules Colle . 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 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!

Comments

2 shown
David Anderson / Team Updraft 2021-02-04T18:13:00+00:00

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

Jules Colle 2021-02-04T19:19:00+00:00

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!