Skip to content
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

Switch to use Stream filter for Network Activated detection. #23

Merged
merged 2 commits into from
Jul 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions inc/stream/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function bootstrap() {
return __( 'Audit Log Records' );
} );

add_filter( 'site_option_active_sitewide_plugins', __NAMESPACE__ . '\\set_stream_networked_activated' );
add_filter( 'wp_stream_is_network_activated', '__return_true' );
add_filter( 'site_option_wp_stream_network', __NAMESPACE__ . '\\default_stream_network_options' );
add_filter( 'default_site_option_wp_stream_network', __NAMESPACE__ . '\\default_stream_network_options' );
add_action( 'network_admin_menu', __NAMESPACE__ . '\\remove_stream_admin_pages', 11 );
Expand All @@ -28,21 +28,6 @@ function default_stream_network_options( $options ) : array {
return $options;
}

/**
* Filter the network wide activated plugin to include stream
*
* This will not actually get included (as the path doesn't exist)
* but this is the only way to trigger Stream's Network Admin configuration
* option.
*
* @param array|bool $plugins
* @return array
*/
function set_stream_networked_activated( $plugins ) : array {
$plugins['stream/stream.php'] = true;
return $plugins;
}

/**
* Remove the stream network admin settings page.
*/
Expand Down