Make WordPress Core


Ignore:
Timestamp:
03/03/2014 04:20:12 PM (10 years ago)
Author:
markjaquith
Message:

Eliminate some of our last remaining create_function() instances

  • Moved some into private function callbacks
  • Eliminated some that weren't necessary anymore

props obenland, markjaquith, nacin. fixes #14424

File:
1 edited

Legend:

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

    r25441 r27373  
    1616function get_importers() {
    1717    global $wp_importers;
    18     if ( is_array($wp_importers) )
    19         uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));
     18    if ( is_array( $wp_importers ) ) {
     19        uasort( $wp_importers, '_uasort_by_first_member' );
     20    }
    2021    return $wp_importers;
     22}
     23
     24/**
     25 * Sorts a multidimensional array by first member of each top level member
     26 *
     27 * Used by uasort() as a callback, should not be used directly.
     28 *
     29 * @since 2.9.0
     30 * @access private
     31 *
     32 * @param array $a
     33 * @param array $b
     34 * @return int
     35 */
     36function _uasort_by_first_member( $a, $b ) {
     37    return strnatcasecmp( $a[0], $b[0] );
    2138}
    2239
Note: See TracChangeset for help on using the changeset viewer.