Make WordPress Core


Ignore:
Timestamp:
11/15/2013 08:14:44 PM (11 years ago)
Author:
nacin
Message:

Dash cleanup.

  • Use wp_add_dashboard_widget() rather than add_meta_box().
  • Use original functions like wp_dashboard_primary(), wp_dashboard_right_now(), wp_dashboard_quick_press() (where possible).
  • Only include plugins section of the news widget when appropriate, which necessitates the set_current_screen() via the ajax action.
  • Remove some debug cruft that was preventing caching and invalidation.
  • Simplify lots of things where possible.

see #25824.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r26144 r26220  
    234234    require_once ABSPATH . 'wp-admin/includes/dashboard.php';
    235235
     236    $pagenow = $_GET['pagenow'];
     237    if ( $pagenow === 'dashboard-user' || $pagenow === 'dashboard-network' || $pagenow === 'dashboard' ) {
     238        set_current_screen( $pagenow );
     239    }
     240
    236241    switch ( $_GET['widget'] ) {
    237         case 'dashboard_rss' :
    238             wp_dashboard_rss();
     242        case 'dashboard_primary' :
     243            wp_dashboard_primary();
    239244            break;
    240245    }
Note: See TracChangeset for help on using the changeset viewer.