Make WordPress Core

Changeset 18314


Ignore:
Timestamp:
06/15/2011 07:23:35 PM (13 years ago)
Author:
nacin
Message:

Anchor the Browse Happy dashboard widget to the top. Reverts [18295], [18296]. Fixes #17781, #17323.

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

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

    r18297 r18314  
    172172    if ( in_array($widget_id, $side_widgets) )
    173173        $location = 'side';
    174     add_meta_box( $widget_id, $widget_name , $callback, $screen->id, $location, 'core' );
     174
     175    $priority = 'core';
     176    if ( 'dashboard_browser_nag' === $widget_id )
     177        $priority = 'high';
     178
     179    add_meta_box( $widget_id, $widget_name, $callback, $screen->id, $location, $priority );
    175180}
    176181
  • trunk/wp-admin/includes/template.php

    r18296 r18314  
    944944        if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) {
    945945            foreach ( $sorted as $box_context => $ids ) {
    946                 $_ids = explode(',', $ids);
    947 
    948                 if ( $k = array_search('dashboard_browser_nag', $_ids, true) ) { // it's ok if this is the first value, i.e. $k == 0
    949                     unset($_ids[$k]);
    950                     array_unshift($_ids, 'dashboard_browser_nag');
    951                 }
    952 
    953                 foreach ( $_ids as $id ) {
     946                foreach ( explode(',', $ids ) as $id ) {
    954947                    if ( $id )
    955948                        add_meta_box( $id, null, null, $page, $box_context, 'sorted' );
Note: See TracChangeset for help on using the changeset viewer.