| @@ -3,8 +3,9 @@ | ||
| 3 | 3 | |
| 4 | 4 | class Network { |
| 5 | 5 | /** |
| 6 | 6 | * Hold Plugin class |
| 7 | + * | |
| 7 | 8 | * @var Plugin |
| 8 | 9 | */ |
| 9 | 10 | public $plugin; |
| 10 | 11 | |
| @@ -90,36 +91,12 @@ | ||
| 90 | 91 | * |
| 91 | 92 | * @return bool |
| 92 | 93 | */ |
| 93 | 94 | public function is_network_activated() { |
| 94 | - if ( ! function_exists( 'is_plugin_active_for_network' ) ) { | |
| 95 | - require_once ABSPATH . '/wp-admin/includes/plugin.php'; | |
| 96 | - } | |
| 97 | - | |
| 98 | - if ( $this->is_mustuse() ) { | |
| 99 | - return true; | |
| 100 | - } | |
| 101 | - | |
| 102 | - return is_plugin_active_for_network( $this->plugin->locations['plugin'] ); | |
| 95 | + return $this->plugin->is_network_activated(); | |
| 103 | 96 | } |
| 104 | 97 | |
| 105 | 98 | /** |
| 106 | - * Returns true if Stream is a must-use plugin, otherwise false | |
| 107 | - * | |
| 108 | - * @return bool | |
| 109 | - */ | |
| 110 | - public function is_mustuse() { | |
| 111 | - | |
| 112 | - $stream_php = trailingslashit( WPMU_PLUGIN_DIR ) . $this->plugin->locations['plugin']; | |
| 113 | - | |
| 114 | - if ( file_exists( $stream_php ) && class_exists( 'WP_Stream\Plugin' ) ) { | |
| 115 | - return true; | |
| 116 | - } | |
| 117 | - | |
| 118 | - return false; | |
| 119 | - } | |
| 120 | - | |
| 121 | - /** | |
| 122 | 99 | * Adds Stream to the admin bar under the "My Sites > Network Admin" menu |
| 123 | 100 | * if Stream has been network-activated. |
| 124 | 101 | * |
| 125 | 102 | * @action admin_bar_menu |
| @@ -200,9 +177,10 @@ | ||
| 200 | 177 | $current_page = wp_stream_filter_input( INPUT_GET, 'page' ); |
| 201 | 178 | $action = add_query_arg( |
| 202 | 179 | array( |
| 203 | 180 | 'action' => $current_page, |
| 204 | - ), 'edit.php' | |
| 181 | + ), | |
| 182 | + 'edit.php' | |
| 205 | 183 | ); |
| 206 | 184 | } |
| 207 | 185 | |
| 208 | 186 | return $action; |