Make WordPress Core


Ignore:
Timestamp:
06/13/2011 12:24:47 AM (15 years ago)
Author:
azaozz
Message:

Make sure the browser nag in shown first on the dashboard no matter what! See #17323

File:
1 edited

Legend:

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

    r18247 r18295  
    944944                if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) {
    945945                        foreach ( $sorted as $box_context => $ids )
    946                                 foreach ( explode(',', $ids) as $id )
     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 ) {
    947954                                        if ( $id )
    948955                                                add_meta_box( $id, null, null, $page, $box_context, 'sorted' );
     956                                }
    949957                }
    950958                $already_sorted = true;
Note: See TracChangeset for help on using the changeset viewer.