WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/11/2010 10:50:36 PM (10 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/widgets.php

    r16269 r16313  
    1616
    1717    $sort = $wp_registered_widgets;
    18     usort( $sort, create_function( '$a, $b', 'return strnatcasecmp( $a["name"], $b["name"] );' ) );
     18    usort( $sort, '_sort_name_callback' );
    1919    $done = array();
    2020
     
    4848
    4949/**
     50 * Callback to sort array by a 'name' key.
     51 *
     52 * @since 3.1.0
     53 * @access private
     54 */
     55function _sort_name_callback( $a, $b ) {
     56    return strnatcasecmp( $a['name'], $b['name'] );
     57}
     58
     59/**
    5060 * Show the widgets and their settings for a sidebar.
    5161 * Used in the the admin widget config screen.
Note: See TracChangeset for help on using the changeset viewer.