Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r16660 r14374  
    88
    99/**
    10  * Display list of the available widgets.
    11  *
    12  * @since 2.5.0
     10 * Display list of the available widgets, either all or matching search.
     11 *
     12 * The search parameter are search terms separated by spaces.
     13 *
     14 * @since unknown
     15 *
     16 * @param string $show Optional, default is all. What to display, can be 'all', 'unused', or 'used'.
     17 * @param string $_search Optional. Search for widgets. Should be unsanitized.
    1318 */
    1419function wp_list_widgets() {
     
    1621
    1722    $sort = $wp_registered_widgets;
    18     usort( $sort, '_sort_name_callback' );
     23    usort( $sort, create_function( '$a, $b', 'return strnatcasecmp( $a["name"], $b["name"] );' ) );
    1924    $done = array();
    2025
     
    4853
    4954/**
    50  * Callback to sort array by a 'name' key.
    51  *
    52  * @since 3.1.0
    53  * @access private
    54  */
    55 function _sort_name_callback( $a, $b ) {
    56     return strnatcasecmp( $a['name'], $b['name'] );
    57 }
    58 
    59 /**
    6055 * Show the widgets and their settings for a sidebar.
    6156 * Used in the the admin widget config screen.
    6257 *
    63  * @since 2.5.0
     58 * @since unknown
    6459 *
    6560 * @param string $sidebar id slug of the sidebar
     
    8580 * {@internal Missing Short Description}}
    8681 *
    87  * @since 2.5.0
     82 * @since unknown
    8883 *
    8984 * @param array $params
     
    9994    $hidden = isset($params[0]['_hide']) ? ' style="display:none;"' : '';
    10095
    101     $params[0]['before_widget'] = "<div id='widget-{$i}_{$id}' class='widget'$hidden>";
     96    $params[0]['before_widget'] = "<div id='widget-${i}_$id' class='widget'$hidden>";
    10297    $params[0]['after_widget'] = "</div>";
    10398    $params[0]['before_title'] = "%BEG_OF_TITLE%"; // deprecated
     
    129124 * Called from dynamic_sidebar().
    130125 *
    131  * @since 2.5.0
     126 * @since unknown
    132127 *
    133128 * @param array $sidebar_args
     
    209204        <div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
    210205        <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback " title="" alt="" />
    211         <?php submit_button( __( 'Save' ), 'button-primary widget-control-save', 'savewidget', false ); ?>
     206        <input type="submit" name="savewidget" class="button-primary widget-control-save" value="<?php esc_attr_e('Save'); ?>" />
    212207        </div>
    213208        <br class="clear" />
Note: See TracChangeset for help on using the changeset viewer.