Make WordPress Core

Changeset 16312


Ignore:
Timestamp:
11/11/2010 10:21:04 PM (14 years ago)
Author:
nacin
Message:

Kill a create_function by introducing is_plugin_inactive. see #14424.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r16281 r16312  
    402402
    403403/**
     404 * Check whether the plugin is inactive.
     405 *
     406 * Reverse of is_plugin_active(). Used as a callback.
     407 *
     408 * @since 3.1.0
     409 * @see is_plugin_active()
     410 *
     411 * @param string $plugin Base plugin path from plugins directory.
     412 * @return bool True if inactive. False if active.
     413 */
     414function is_plugin_inactive( $plugin ) {
     415    return ! is_plugin_active( $plugin );
     416}
     417
     418/**
    404419 * Check whether the plugin is active for the entire network.
    405420 *
  • trunk/wp-admin/plugins.php

    r16194 r16312  
    187187            //$_POST = from the plugin form; $_GET = from the FTP details screen.
    188188            $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
    189             $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins.
     189            $plugins = array_filter($plugins, 'is_plugin_inactive'); // Do not allow to delete Activated plugins.
    190190            if ( empty($plugins) ) {
    191191                wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
Note: See TracChangeset for help on using the changeset viewer.