WP_Recovery_Mode::is_network_plugin( array $extension ): bool

In this article

Checks whether the given extension a network activated plugin.

Parameters

$extensionarrayrequired
Extension data.

Return

bool True if network plugin, false otherwise.

Source

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 ( str_starts_with( $plugin, $extension['slug'] . '/' ) ) {
			return true;
		}
	}

	return false;
}

Changelog

VersionDescription
5.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.