Introduce perflab_active_modules filter to control which modules are active#87
Introduce perflab_active_modules filter to control which modules are active#87felixarntz merged 8 commits intotrunkfrom
perflab_active_modules filter to control which modules are active#87Conversation
felixarntz
left a comment
There was a problem hiding this comment.
@eugene-manuilov Looks great!
I left one comment below that doesn't block this from being merged, but we'll need to keep this in mind. Maybe it's better for now to put 1.0.0 like we have elsewhere. However, I think it'd be great to have an issue bringing up the n.e.x.t proposal.
load.php
Outdated
| /** | ||
| * Filters active modules to allow programmatically control which modules are active. | ||
| * | ||
| * @since n.e.x.t |
There was a problem hiding this comment.
We don't have the n.e.x.t convention here so far, but it's worth evaluating. Do you mind opening an issue where we can propose/discuss it? It would be important to document this somewhere eventually. We haven't published a release yet, but once we get to that, we'll need to have documentation anyway.
Maybe we could even have a npm script that replaces all n.e.x.t occurrences with a specific version.
felixarntz
left a comment
There was a problem hiding this comment.
Re-approving for the additional (mini-)change.
|
@eugene-manuilov could provide a snippet of how to test the filter, in a mu-plugin for instance? Thanks :) |
add_filter( 'perflab_active_modules', function ( $modules ) {
return array_diff( $modules, [ "foo", "bar" ] ); // modules you want to remove
} );
add_filter( 'perflab_active_modules', function ( $modules ) {
return array_merge( $modules, [ "foo", "bar" ] ); // modules you want to add
} ); |
|
Thanks, @tillkruss |
perflab_active_modules filter to control which modules are active
Addresses #33