On this page
WP_Recovery_Mode::is_network_plugin( array $extension ): bool
Checks whether the given extension a network activated plugin.
Parameters
$extensionarray Required-
Extension data.
Return
bool True if network plugin, false otherwise.
Source
File: wp-includes/class-wp-recovery-mode.php. View all references
protected function is_network_plugin( $extension ) {
if ( 'plugin' !== $extension['type'] ) {
return false;
}
if ( ! is_multisite() ) {
return false;
}
$network_plugins = wp_get_active_network_plugins();
foreach ( $network_plugins as $plugin ) {
if ( 0 === strpos( $plugin, $extension['slug'] . '/' ) ) {
return true;
}
}
return false;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_get_active_network_plugins() wp-includes/ms-load.php | Returns array of network plugin files to be included in global scope. |
| is_multisite() wp-includes/load.php | If Multisite is enabled. |
Used By
| Used By | Description |
|---|---|
| WP_Recovery_Mode::handle_error() wp-includes/class-wp-recovery-mode.php | Handles a fatal error occurring. |
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_recovery_mode/is_network_plugin