diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 1f0df7a761..a53130c860 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -25,47 +25,42 @@ function wp_dashboard_setup() { /* Register Widgets and Controls */ // Right Now - if ( is_blog_admin() && current_user_can('edit_posts') ) - wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' ); + wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' ); // Recent Comments Widget - if ( is_blog_admin() && current_user_can('moderate_comments') ) { - if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) { - $update = true; - $widget_options['dashboard_recent_comments'] = array( - 'items' => 5, - ); - } - $recent_comments_title = __( 'Recent Comments' ); - wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' ); + if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) { + $update = true; + $widget_options['dashboard_recent_comments'] = array( + 'items' => 5, + ); } + $recent_comments_title = __( 'Recent Comments' ); + wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' ); // Incoming Links Widget - if ( is_blog_admin() && current_user_can('publish_posts') ) { - if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { - $update = true; - $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10; - $widget_options['dashboard_incoming_links'] = array( - 'home' => get_option('home'), - 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), - 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), - 'items' => $num_items, - 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false - ); - } - wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); + if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { + $update = true; + $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10; + $widget_options['dashboard_incoming_links'] = array( + 'home' => get_option('home'), + 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), + 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), + 'items' => $num_items, + 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false + ); } + wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); // WP Plugins Widget - if ( is_blog_admin() && current_user_can( 'install_plugins' ) ) + if ( current_user_can( 'install_plugins' ) ) wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' ); // QuickPress Widget - if ( is_blog_admin() && current_user_can('edit_posts') ) + if ( current_user_can('edit_posts') ) wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' ); // Recent Drafts - if ( is_blog_admin() && current_user_can('edit_posts') ) + if ( current_user_can('edit_posts') ) wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' ); // Primary feed (Dev Blog) Widget diff --git a/wp-admin/includes/default-list-tables.php b/wp-admin/includes/default-list-tables.php index 6c1fc85f2a..62ffe9a243 100644 --- a/wp-admin/includes/default-list-tables.php +++ b/wp-admin/includes/default-list-tables.php @@ -3140,14 +3140,14 @@ class WP_MS_Users_Table extends WP_List_Table { $edit_link = ( get_current_user_id() == $user->ID ) ? 'profile.php' : 'user-edit.php?user_id=' . $user->ID; ?>