I would like to know if there is way to only activate plugins (my own custom plugins) for specific users?
Is there a way to do this using PHP myself and determine which plugin loads based on either user ID or role (or any other factor really).
If this isn't possible, is it possible within the plugin itself to determine which plugin files are loaded again based on the user or role?
I have tried this before in the main plugin file that includes all of my plugin files, but it seems to break the site when I do something like:
if(get_current_user_ID() == 9) {
include_once(dirname(__FILE__)."/MyPluginFiles/Directoryone/Controller.php");
} else {
include_once(dirname(__FILE__)."/MyPluginFilesAlternate/Directoryone/Controller.php");
}
So is there some other way to accomplish this? I wanting to roll out the new plugin, but make it selectable so that people can choose the old experience or the new experience and this would be an easy way to do that I would think.