diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 155459813d..55ccdcbbad 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -35,6 +35,33 @@ function wp_dashboard_setup() { array( 'all_link' => 'edit-comments.php', 'notice' => $notice, 'width' => 'half' ) ); + + // QuickPress Widget + if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) ) { + $view = get_permalink( $_POST['post_ID'] ); + $edit = clean_url( get_edit_post_link( $_POST['post_ID'] ) ); + if ( 'post-quickpress-publish' == $_POST['action'] ) + $notice = sprintf( __( 'Post Published. View post | Edit post' ), clean_url( $view ), $edit ); + else + $notice = sprintf( __( 'Draft Saved. Preview post | Edit post' ), clean_url( add_query_arg( 'preview', 1, $view ) ), $edit ); + } else { + $notice = ''; + } + wp_register_sidebar_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press', + array( 'all_link' => array( 'edit.php?post_status=draft', __('View All Drafts') ), 'width' => 'half', 'height' => 'double', 'notice' => $notice ) + ); + wp_register_widget_control( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_empty_control', + array( 'widget_id' => 'dashboard_quick_press' ) + ); + + // Inbox Widget + wp_register_sidebar_widget( 'dashboard_inbox', __( 'Inbox' ), 'wp_dashboard_inbox', + array( 'all_link' => 'inbox.php', 'height' => 'double' ) + ); + wp_register_widget_control( 'dashboard_inbox', __( 'Inbox' ), 'wp_dashboard_empty_control', + array( 'widget_id' => 'dashboard_inbox' ) + ); + // Incoming Links Widget 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; @@ -106,7 +133,7 @@ function wp_dashboard_setup() { /* Dashboard Widget Template wp_register_sidebar_widget( $widget_id (unique slug) , $widget_title, $output_callback, array( - 'all_link' => full url for "See All" link, + 'all_link' => full url for "View All" link, 'feed_link' => full url for "RSS" link, 'width' => 'fourth', 'third', 'half', 'full' (defaults to 'half'), 'height' => 'single', 'double' (defaults to 'single'), @@ -132,15 +159,23 @@ function wp_dashboard_setup() { // Hard code the sidebar's widgets and order $dashboard_widgets = array(); + $dashboard_widgets[] = 'dashboard_inbox'; + $dashboard_widgets[] = 'dashboard_quick_press'; +/* $dashboard_widgets[] = 'dashboard_recent_comments'; $dashboard_widgets[] = 'dashboard_incoming_links'; $dashboard_widgets[] = 'dashboard_primary'; if ( current_user_can( 'activate_plugins' ) ) $dashboard_widgets[] = 'dashboard_plugins'; +*/ $dashboard_widgets[] = 'dashboard_secondary'; // Filter widget order $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', $dashboard_widgets ); + if ( in_array( 'dashboard_quick_press', $dashboard_widgets ) ) { +// add_action( 'admin_head', 'wp_teeny_mce' ); + add_action( 'admin_head', 'wp_dashboard_quick_press_js' ); + } $wp_dashboard_sidebars = array( 'wp_dashboard' => $dashboard_widgets, 'array_version' => 3.5 ); @@ -205,9 +240,11 @@ function wp_dashboard_dynamic_sidebar_params( $params ) { if ( $the_classes ) $sidebar_before_widget = str_replace( "