wpseek.com
A WordPress-centric search engine for devs and theme authors
is_network_only_plugin › WordPress Function
Since3.0.0
Deprecatedn/a
› is_network_only_plugin ( $plugin )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
| Codex: | |
| Change Log: |
|
Checks for "Network: true" in the plugin header to see if this should be activated only as a network wide plugin. The plugin would also work when Multisite is not enabled.
Checks for "Site Wide Only: true" for backward compatibility.Related Functions: is_network_admin, add_network_option, get_network_option, wp_get_active_network_plugins, delete_network_option
Source
function is_network_only_plugin( $plugin ) {
// Normalize the path the same way activate_plugin() does, so both agree on the file.
$plugin = plugin_basename( trim( $plugin ) );
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
if ( $plugin_data ) {
return $plugin_data['Network'];
}
return false;
}