Make WordPress Core

Ticket #27299: 27299.2.patch

File 27299.2.patch, 1.1 KB (added by nofearinc, 11 years ago)

Update docs and add to customizer too

  • wp-admin/includes/widgets.php

     
    1616
    1717        $sort = $wp_registered_widgets;
    1818        usort( $sort, '_sort_name_callback' );
     19        /**
     20         * Filter the widgets order for the Widgets screen.
     21         *
     22         * @since 4.1
     23         *
     24         * @param array      $sort the alphabetically ordered list of available widgets.
     25         */
     26        $sort = apply_filters( 'available_widgets_order', $sort );
     27       
    1928        $done = array();
    2029
    2130        foreach ( $sort as $widget ) {
  • wp-includes/class-wp-customize-widgets.php

     
    861861
    862862                $sort = $wp_registered_widgets;
    863863                usort( $sort, array( $this, '_sort_name_callback' ) );
     864                /** This filter is documented in wp-admin/includes/widgets.php */
     865                $sort = apply_filters( 'available_widgets_order', $sort );
     866               
    864867                $done = array();
    865868
    866869                foreach ( $sort as $widget ) {