-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow is_network_activated to be filtered #1003
Conversation
Thanks so much @joehoyle! Is this ready for code review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Travis errors are due to wp-dev-lib
using the latest version of WordPress 5.2 which doesn't support PHP below version 5.6:
Your server is running PHP version 5.4.45 but WordPress 5.2.1-src requires at least 5.6.20.
So we're OK to ignore that.
Yup, good stuff! |
Very elegant! Thanks @joehoyle :) |
Currently there's no way to filter the network activated detection (bar filtering the option plugins activated value). This means unless the
is_mustuse
is triggered, you can't get the network wide behaviour when loading Stream in other ways.I refactored this into a method that is consistenty used on the
Plugin
class, and also added a filter. Forcing network behaviour is then just a case of doingadd_filter( 'wp_stream_is_network_activated', '__return_true' );