Include instead of exclude, and cron
-
Hi,
I was about to write a plugin using the same approach – and thankfully someone pointed me here!
Reading the code, I have two comments:
1) I wanted to include only on certain URLs, rather than exclude only on certain URLs. (My use case was a forum plugin – I want it only to load when the URL contains /forum).
2) I think that as well as checking for is_admin() (so that all plugins always load on is_admin()), you should also check for WP_CRON, and always load with WP_CRON, to avoid accidentally disabling tasks that plugins perform via cron.
Also – it might help to explicitly say in the installation instructions that the fact that it’s an mu-plugin means that the plugin’s PHP file needs putting in wp-content/mu-plugins (I understood this, but some people might not realise).
David
- The topic ‘Include instead of exclude, and cron’ is closed to new replies.