Conditional Plugin Activation

Is there a class or function that anyone has came up with to utilize switching between WP and CP on plugin activation?

I know you can simply check for ‘if version < 4.9’ of a WP (or CP) install but has anyone found a smooth “system” to toggle the whole plugin to load only the CP “parts” (files/functions/classes) of a plugin if the instance is CP?

This is not real important but it would be a nice thing to have on activation and for the autoloader/loader class, to be able to detect and load separte instances of a plugin. (maybe… opinions?)

Is this what you’re referring to?

1 Like

This is the right way.

@viktor Yes, this will help. I guess it is all one really needs. If Boolean fails then I can assume it is WP and not CP - or - double up on WP by looking for version of WP if CP fails.

I just wasn’t sure if someone had a script written for a plugin activation callback. But thanks for the link and this thread can be closed if no one else has anything to add.

I don’t know of many plugins that do this. Only one I’ve seen use this is Subscribe2:

1 Like

This topic was automatically closed after 3 days. New replies are no longer allowed.