Actualizacion 7.1.2
This commit is contained in:
@@ -598,11 +598,17 @@ function is_plugin_active_for_network( $plugin ) {
|
||||
* Checks for "Site Wide Only: true" for backward compatibility.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @since 7.1.1 The `$plugin` path is normalized with `plugin_basename()` and `trim()`,
|
||||
* matching how `activate_plugin()` resolves it.
|
||||
*
|
||||
* @param string $plugin Path to the plugin file relative to the plugins directory.
|
||||
* @param string $plugin Path to the plugin file. Accepts a path relative to the plugins
|
||||
* directory, or an absolute path, with or without surrounding whitespace.
|
||||
* @return bool True if plugin is network only, false otherwise.
|
||||
*/
|
||||
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'];
|
||||
|
||||
Reference in New Issue
Block a user