WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/11/2010 10:50:36 PM (9 years ago)
Author:
nacin
Message:

Remove more create_function calls. props huichen, see #14424.

File:
1 edited

Legend:

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

    r16312 r16313  
    261261    }
    262262
    263     uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
     263    uasort( $wp_plugins, '_sort_uname_callback' );
    264264
    265265    $cache_plugins[ $plugin_folder ] = $wp_plugins;
     
    313313        unset( $wp_plugins['index.php'] );
    314314
    315     uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
     315    uasort( $wp_plugins, '_sort_uname_callback' );
    316316
    317317    return $wp_plugins;
     318}
     319
     320/**
     321 * Callback to sort array by a 'Name' key.
     322 *
     323 * @since 3.1.0
     324 * @access private
     325 */
     326function _sort_uname_callback( $a, $b ) {
     327    return strnatcasecmp( $a['Name'], $b['Name'] );
    318328}
    319329
     
    354364    }
    355365
    356     uksort( $dropins, create_function( '$a, $b', 'return strnatcasecmp( $a, $b );' ));
     366    uksort( $dropins, 'strnatcasecmp' );
    357367
    358368    return $dropins;
Note: See TracChangeset for help on using the changeset viewer.