My views on ClassicPress are pretty public and, what is clear, is that ClassicPress is likely to deviate from WordPress in the future, probably their “Phase 2”. Numerous proposed changes, some of them quite small, will potentially cause issues for existing code, particularly plugins.
As a plugin developer, I don’t wish to end up supporting users running a deviated fork of WordPress. Don’t get me wrong, this isn’t “because it’s ClassicPress” – if tomorrow, Drupal created a way of running WordPress plugins on their platform, I probably wouldn’t support those either. I created my plugins for WordPress users and providing support for anything more is, personally, not something I’m interested in doing. The same for any other fork of WordPress that was popular.
Thankfully, it’s relatively easy to detect and block use of ClassicPress within your plugins (and themes), if that’s something you wish to do.
So, here’s some code that can be used within your theme or plugin code…
This introduces 2 things…
- A function named
is_classicpress– call this to determine if the current CMS being used is ClassicPress (it returns
- An admin notice informing the user that ClassicPress is not supported. The output message defaults to an assumption that this is for a plugin but can be modified to taste.
The idea is that, within your plugin, you’d use the
is_classicpressfunction to determine if ClassicPress is in use and, if so, not trigger any of your plugin functions – the admin notice is then informing them of why this is. It’s more difficult to achieve the same with a theme, so you’d probably miss out this step and just use the notice to inform the user that the theme isn’t supported on their platform. The notice is non-dismissible for good reason.
Just to be clear – right now, ClassicPress is compatible with WordPress, so running plugins and themes under ClassicPress shouldn’t cause any support issues. As a result there is no need to be using this code – however, it’s a useful consideration for the future.
Note: this post has been revised since original publication, after discussion with the ClassicPress community