Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r14374 r16660  
    88
    99/**
    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.
     10 * Display list of the available widgets.
     11 *
     12 * @since 2.5.0
    1813 */
    1914function wp_list_widgets() {
     
    2116
    2217    $sort = $wp_registered_widgets;
    23     usort( $sort, create_function( '$a, $b', 'return strnatcasecmp( $a["name"], $b["name"] );' ) );
     18    usort( $sort, '_sort_name_callback' );
    2419    $done = array();
    2520
     
    5348
    5449/**
     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/**
    5560 * Show the widgets and their settings for a sidebar.
    5661 * Used in the the admin widget config screen.
    5762 *
    58  * @since unknown
     63 * @since 2.5.0
    5964 *
    6065 * @param string $sidebar id slug of the sidebar
     
    8085 * {@internal Missing Short Description}}
    8186 *
    82  * @since unknown
     87 * @since 2.5.0
    8388 *
    8489 * @param array $params
     
    9499    $hidden = isset($params[0]['_hide']) ? ' style="display:none;"' : '';
    95100
    96     $params[0]['before_widget'] = "<div id='widget-${i}_$id' class='widget'$hidden>";
     101    $params[0]['before_widget'] = "<div id='widget-{$i}_{$id}' class='widget'$hidden>";
    97102    $params[0]['after_widget'] = "</div>";
    98103    $params[0]['before_title'] = "%BEG_OF_TITLE%"; // deprecated
     
    124129 * Called from dynamic_sidebar().
    125130 *
    126  * @since unknown
     131 * @since 2.5.0
    127132 *
    128133 * @param array $sidebar_args
     
    204209        <div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
    205210        <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback " title="" alt="" />
    206         <input type="submit" name="savewidget" class="button-primary widget-control-save" value="<?php esc_attr_e('Save'); ?>" />
     211        <?php submit_button( __( 'Save' ), 'button-primary widget-control-save', 'savewidget', false ); ?>
    207212        </div>
    208213        <br class="clear" />
Note: See TracChangeset for help on using the changeset viewer.