diff --git a/src/wp-admin/css/wp-admin.css b/src/wp-admin/css/wp-admin.css index 9270fee4e6..917516c452 100644 --- a/src/wp-admin/css/wp-admin.css +++ b/src/wp-admin/css/wp-admin.css @@ -2969,19 +2969,19 @@ body #dashboard-widgets .postbox form .submit { /* Dashboard Quick Draft */ -#dashboard_quick_draft div.updated { +#dashboard_quick_press div.updated { margin-bottom: 10px; border: 1px solid #eee; border-width: 1px 1px 1px 0; } -#dashboard_quick_draft form { +#dashboard_quick_press form { padding: 0 12px 1px 12px; overflow: hidden; } -#dashboard_quick_draft .drafts, -#dashboard_quick_draft .easy-blogging { +#dashboard_quick_press .drafts, +#dashboard_quick_press .easy-blogging { padding: 8px 12px 0; } @@ -3012,15 +3012,15 @@ form.initial-form.quickpress-open input#title { height: auto; } -#dashboard_quick_draft input, -#dashboard_quick_draft textarea { +#dashboard_quick_press input, +#dashboard_quick_press textarea { box-sizing: border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; margin: 0; } -#dashboard_quick_draft textarea { +#dashboard_quick_press textarea { resize: vertical; } @@ -3070,21 +3070,21 @@ form.initial-form.quickpress-open input#title { /* Dashboard Quick Draft - Drafts list */ -#dashboard_quick_draft .drafts { +#dashboard_quick_press .drafts { border-top: 1px solid #eee; margin-top: 12px; } -#dashboard_quick_draft .drafts abbr { +#dashboard_quick_press .drafts abbr { border: none; } -#dashboard_quick_draft .drafts h4 { +#dashboard_quick_press .drafts h4 { margin: 0 0 8px 0; font-weight: normal; } -#dashboard_quick_draft .drafts .view-all { +#dashboard_quick_press .drafts .view-all { float: right; margin-top: 0; } diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 2533dd6fa5..a28e2c68c0 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -233,9 +233,14 @@ function wp_ajax_autocomplete_user() { function wp_ajax_dashboard_widgets() { require_once ABSPATH . 'wp-admin/includes/dashboard.php'; + $pagenow = $_GET['pagenow']; + if ( $pagenow === 'dashboard-user' || $pagenow === 'dashboard-network' || $pagenow === 'dashboard' ) { + set_current_screen( $pagenow ); + } + switch ( $_GET['widget'] ) { - case 'dashboard_rss' : - wp_dashboard_rss(); + case 'dashboard_primary' : + wp_dashboard_primary(); break; } wp_die(); diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 0991dd3cf5..90fe304112 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -37,20 +37,20 @@ function wp_dashboard_setup() { // Right Now if ( is_blog_admin() && current_user_can('edit_posts') ) - add_meta_box( 'dash-right-now', 'Site Content', 'dashboard_new_right_now', 'dashboard', 'normal', 'high' ); + wp_add_dashboard_widget( 'dash-right-now', __( 'Site Content' ), 'wp_dashboard_right_now' ); if ( is_network_admin() ) wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' ); // Activity Widget - add_meta_box( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_activity', 'dashboard', 'normal', 'high' ); + wp_add_dashboard_widget( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_activity' ); // QuickPress Widget if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) - add_meta_box( 'dashboard_quick_draft', __( 'Quick Draft' ), 'wp_dashboard_quick_draft', 'dashboard', 'side', 'high' ); + wp_add_dashboard_widget( 'dashboard_quick_press', __( 'Quick Draft' ), 'wp_dashboard_quick_press' ); // WordPress News - add_meta_box( 'dashboard_rss', __( 'WordPress News' ), 'wp_dashboard_rss', 'dashboard', 'side', 'low' ); + wp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress News' ), 'wp_dashboard_primary' ); // Hook to register new widgets // Filter widget order @@ -104,12 +104,7 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_ } } - if ( is_blog_admin () ) - $side_widgets = array('dashboard_quick_draft'); - else if (is_network_admin() ) - $side_widgets = array(); - else - $side_widgets = array(); + $side_widgets = array( 'dashboard_quick_press', 'dashboard_primary' ); $location = 'normal'; if ( in_array($widget_id, $side_widgets) ) @@ -118,6 +113,8 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_ $priority = 'core'; if ( 'dashboard_browser_nag' === $widget_id ) $priority = 'high'; + elseif ( 'dashboard_primary' === $widget_id ) + $priority = 'low'; add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority, $callback_args ); } @@ -164,7 +161,14 @@ function wp_dashboard() { /* Dashboard Widgets */ -function dashboard_new_right_now() { +/** + * Dashboard widget that displays some basic stats about the site. + * + * Formerly 'Right Now'. A streamlined 'Site Content' as of 3.8. + * + * @since 2.7.0 + */ +function wp_dashboard_right_now() { $theme = wp_get_theme(); if ( current_user_can( 'switch_themes' ) ) $theme_name = sprintf( '%1$s', $theme->display('Name') ); @@ -283,7 +287,7 @@ function wp_network_dashboard_right_now() { * @since 3.8.0 * */ -function wp_dashboard_quick_draft( $error_msg=false ) { +function wp_dashboard_quick_press( $error_msg=false ) { global $post_ID; /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */ @@ -305,8 +309,6 @@ function wp_dashboard_quick_draft( $error_msg=false ) { } $post_ID = (int) $post->ID; - - do_action( 'dashboard_quickdraft_beginning', $post ); ?>