Ticket #25824: 25824.diff
File 25824.diff, 70.9 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/ajax-actions.php
234 234 require_once ABSPATH . 'wp-admin/includes/dashboard.php'; 235 235 236 236 switch ( $_GET['widget'] ) { 237 case 'dashboard_ incoming_links' :238 wp_dashboard_ incoming_links();237 case 'dashboard_rss' : 238 wp_dashboard_rss(); 239 239 break; 240 case 'dashboard_primary' :241 wp_dashboard_primary();242 break;243 case 'dashboard_secondary' :244 wp_dashboard_secondary();245 break;246 case 'dashboard_plugins' :247 wp_dashboard_plugins();248 break;249 240 } 250 241 wp_die(); 251 242 } -
wp-admin/includes/dashboard.php
6 6 * @subpackage Administration 7 7 */ 8 8 9 /* Temporary hack until MP6 is in core 10 * MP6 currently unenqueues wp-admin/css/wp-admin.css 11 * After MP6 merges: 12 * - add the styles in temporary-dash-styles.css to wp-admin 13 * - and DELETE THIS FUNCTION, 14 */ 15 function temporary_dash_styles() { 16 wp_add_inline_style( 'wp-admin', file_get_contents( ABSPATH . 'wp-admin/css/temporary-dash-styles.css' ) ); 17 } 18 add_action( 'admin_enqueue_scripts', 'temporary_dash_styles' ); 19 9 20 /** 10 21 * Registers dashboard widgets. 11 22 * … … 37 48 38 49 // Right Now 39 50 if ( is_blog_admin() && current_user_can('edit_posts') ) 40 wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );51 add_meta_box( 'dash-right-now', 'Site Content', 'dashboard_new_right_now', 'dashboard', 'normal', 'high' ); 41 52 42 53 if ( is_network_admin() ) 43 54 wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' ); 44 55 45 // Recent Comments Widget 46 if ( is_blog_admin() && current_user_can('moderate_comments') ) { 47 if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) { 48 $update = true; 49 $widget_options['dashboard_recent_comments'] = array( 50 'items' => 5, 51 ); 52 } 53 $recent_comments_title = __( 'Recent Comments' ); 54 wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' ); 55 } 56 // Activity Widget 57 add_meta_box( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_activity', 'dashboard', 'normal', 'high' ); 56 58 57 // Incoming Links Widget58 if ( is_blog_admin() && current_user_can('publish_posts') ) {59 if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {60 $update = true;61 $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;62 $widget_options['dashboard_incoming_links'] = array(63 'home' => get_option('home'),64 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),65 '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') ) ),66 'items' => $num_items,67 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false68 );69 }70 wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );71 }72 73 // WP Plugins Widget74 if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )75 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );76 77 59 // QuickPress Widget 78 if ( is_blog_admin() && current_user_can('edit_posts') ) 79 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' ); 60 if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) 61 add_meta_box( 'dashboard_quick_draft', __( 'Quick Draft' ), 'wp_dashboard_quick_draft', 'dashboard', 'side', 'high' ); 62 63 // WordPress News 64 add_meta_box( 'dashboard_rss', __( 'WordPress News' ), 'wp_dashboard_rss', 'dashboard', 'side', 'low' ); 80 65 81 // Recent Drafts82 if ( is_blog_admin() && current_user_can('edit_posts') )83 wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );84 85 // Primary feed (Dev Blog) Widget86 if ( !isset( $widget_options['dashboard_primary'] ) ) {87 $update = true;88 $widget_options['dashboard_primary'] = array(89 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),90 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),91 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),92 'items' => 2,93 'show_summary' => 1,94 'show_author' => 0,95 'show_date' => 1,96 );97 }98 wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' );99 100 // Secondary Feed (Planet) Widget101 if ( !isset( $widget_options['dashboard_secondary'] ) ) {102 $update = true;103 $widget_options['dashboard_secondary'] = array(104 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ),105 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ),106 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),107 'items' => 5,108 'show_summary' => 0,109 'show_author' => 0,110 'show_date' => 0,111 );112 }113 wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' );114 115 66 // Hook to register new widgets 116 67 // Filter widget order 117 68 if ( is_network_admin() ) { … … 165 116 } 166 117 167 118 if ( is_blog_admin () ) 168 $side_widgets = array('dashboard_quick_ press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');119 $side_widgets = array('dashboard_quick_draft'); 169 120 else if (is_network_admin() ) 170 $side_widgets = array( 'dashboard_primary', 'dashboard_secondary');121 $side_widgets = array(); 171 122 else 172 123 $side_widgets = array(); 173 124 … … 224 175 225 176 /* Dashboard Widgets */ 226 177 227 function wp_dashboard_right_now() { 228 global $wp_registered_sidebars; 229 230 $num_posts = wp_count_posts( 'post' ); 231 $num_pages = wp_count_posts( 'page' ); 232 233 $num_cats = wp_count_terms('category'); 234 235 $num_tags = wp_count_terms('post_tag'); 236 237 $num_comm = wp_count_comments(); 238 239 echo "\n\t".'<div class="table table_content">'; 240 echo "\n\t".'<p class="sub">' . __('Content') . '</p>'."\n\t".'<table>'; 241 echo "\n\t".'<tr class="first">'; 242 243 // Posts 244 $num = number_format_i18n( $num_posts->publish ); 245 $text = _n( 'Post', 'Posts', intval($num_posts->publish) ); 246 if ( current_user_can( 'edit_posts' ) ) { 247 $num = "<a href='edit.php'>$num</a>"; 248 $text = "<a href='edit.php'>$text</a>"; 249 } 250 echo '<td class="first b b-posts">' . $num . '</td>'; 251 echo '<td class="t posts">' . $text . '</td>'; 252 253 echo '</tr><tr>'; 254 /* TODO: Show status breakdown on hover 255 if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can 256 $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( _n( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>'; 257 } 258 if ( $can_edit_posts && !empty($num_posts->draft) ) { 259 $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( _n( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'</a>'; 260 } 261 if ( $can_edit_posts && !empty($num_posts->future) ) { 262 $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( _n( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'</a>'; 263 } 264 if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) { 265 $pending_text = sprintf( _n( 'There is <a href="%1$s">%2$s post</a> pending your review.', 'There are <a href="%1$s">%2$s posts</a> pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) ); 266 } else { 267 $pending_text = ''; 268 } 269 */ 270 271 // Pages 272 $num = number_format_i18n( $num_pages->publish ); 273 $text = _n( 'Page', 'Pages', $num_pages->publish ); 274 if ( current_user_can( 'edit_pages' ) ) { 275 $num = "<a href='edit.php?post_type=page'>$num</a>"; 276 $text = "<a href='edit.php?post_type=page'>$text</a>"; 277 } 278 echo '<td class="first b b_pages">' . $num . '</td>'; 279 echo '<td class="t pages">' . $text . '</td>'; 280 281 echo '</tr><tr>'; 282 283 // Categories 284 $num = number_format_i18n( $num_cats ); 285 $text = _n( 'Category', 'Categories', $num_cats ); 286 if ( current_user_can( 'manage_categories' ) ) { 287 $num = "<a href='edit-tags.php?taxonomy=category'>$num</a>"; 288 $text = "<a href='edit-tags.php?taxonomy=category'>$text</a>"; 289 } 290 echo '<td class="first b b-cats">' . $num . '</td>'; 291 echo '<td class="t cats">' . $text . '</td>'; 292 293 echo '</tr><tr>'; 294 295 // Tags 296 $num = number_format_i18n( $num_tags ); 297 $text = _n( 'Tag', 'Tags', $num_tags ); 298 if ( current_user_can( 'manage_categories' ) ) { 299 $num = "<a href='edit-tags.php'>$num</a>"; 300 $text = "<a href='edit-tags.php'>$text</a>"; 301 } 302 echo '<td class="first b b-tags">' . $num . '</td>'; 303 echo '<td class="t tags">' . $text . '</td>'; 304 305 echo "</tr>"; 306 do_action('right_now_content_table_end'); 307 echo "\n\t</table>\n\t</div>"; 308 309 echo "\n\t".'<div class="table table_discussion">'; 310 echo "\n\t".'<p class="sub">' . __('Discussion') . '</p>'."\n\t".'<table>'; 311 echo "\n\t".'<tr class="first">'; 312 313 // Total Comments 314 $num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>'; 315 $text = _n( 'Comment', 'Comments', $num_comm->total_comments ); 316 if ( current_user_can( 'moderate_comments' ) ) { 317 $num = '<a href="edit-comments.php">' . $num . '</a>'; 318 $text = '<a href="edit-comments.php">' . $text . '</a>'; 319 } 320 echo '<td class="b b-comments">' . $num . '</td>'; 321 echo '<td class="last t comments">' . $text . '</td>'; 322 323 echo '</tr><tr>'; 324 325 // Approved Comments 326 $num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>'; 327 $text = _nx( 'Approved', 'Approved', $num_comm->approved, 'Right Now' ); 328 if ( current_user_can( 'moderate_comments' ) ) { 329 $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>"; 330 $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>$text</a>"; 331 } 332 echo '<td class="b b_approved">' . $num . '</td>'; 333 echo '<td class="last t">' . $text . '</td>'; 334 335 echo "</tr>\n\t<tr>"; 336 337 // Pending Comments 338 $num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>'; 339 $text = _n( 'Pending', 'Pending', $num_comm->moderated ); 340 if ( current_user_can( 'moderate_comments' ) ) { 341 $num = "<a href='edit-comments.php?comment_status=moderated'>$num</a>"; 342 $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>"; 343 } 344 echo '<td class="b b-waiting">' . $num . '</td>'; 345 echo '<td class="last t">' . $text . '</td>'; 346 347 echo "</tr>\n\t<tr>"; 348 349 // Spam Comments 350 $num = number_format_i18n($num_comm->spam); 351 $text = _nx( 'Spam', 'Spam', $num_comm->spam, 'comment' ); 352 if ( current_user_can( 'moderate_comments' ) ) { 353 $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>"; 354 $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>$text</a>"; 355 } 356 echo '<td class="b b-spam">' . $num . '</td>'; 357 echo '<td class="last t">' . $text . '</td>'; 358 359 echo "</tr>"; 360 do_action('right_now_table_end'); 361 do_action('right_now_discussion_table_end'); 362 echo "\n\t</table>\n\t</div>"; 363 364 echo "\n\t".'<div class="versions">'; 178 function dashboard_new_right_now() { 365 179 $theme = wp_get_theme(); 366 367 echo "\n\t<p>"; 368 369 if ( $theme->errors() ) { 370 if ( ! is_multisite() || is_super_admin() ) 371 echo '<span class="error-message">' . sprintf( __( 'ERROR: %s' ), $theme->errors()->get_error_message() ) . '</span>'; 372 } elseif ( ! empty($wp_registered_sidebars) ) { 373 $sidebars_widgets = wp_get_sidebars_widgets(); 374 $num_widgets = 0; 375 foreach ( (array) $sidebars_widgets as $k => $v ) { 376 if ( 'wp_inactive_widgets' == $k || 'orphaned_widgets' == substr( $k, 0, 16 ) ) 377 continue; 378 if ( is_array($v) ) 379 $num_widgets = $num_widgets + count($v); 180 if ( current_user_can( 'switch_themes' ) ) 181 $theme_name = sprintf( '<a href="themes.php">%1$s</a>', $theme->display('Name') ); 182 else 183 $theme_name = $theme->display('Name'); 184 ?> 185 <div class="main"> 186 <ul> 187 <?php 188 do_action( 'rightnow_list_start' ); 189 // Using show_in_nav_menus as my arg for grabbing what post types should show, is there better? 190 $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' ); 191 $post_types = (array) apply_filters( 'rightnow_post_types', $post_types ); 192 foreach ( $post_types as $post_type => $post_type_obj ){ 193 $num_posts = wp_count_posts( $post_type ); 194 if ( $num_posts && $num_posts->publish ) { 195 printf( 196 '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s %3$s</a></li>', 197 $post_type, 198 number_format_i18n( $num_posts->publish ), 199 $post_type_obj->label 200 ); 380 201 } 381 $num = number_format_i18n( $num_widgets ); 382 383 $switch_themes = $theme->display('Name'); 384 if ( current_user_can( 'switch_themes') ) 385 $switch_themes = '<a href="themes.php">' . $switch_themes . '</a>'; 386 if ( current_user_can( 'edit_theme_options' ) ) { 387 printf(_n('Theme <span class="b">%1$s</span> with <span class="b"><a href="widgets.php">%2$s Widget</a></span>', 'Theme <span class="b">%1$s</span> with <span class="b"><a href="widgets.php">%2$s Widgets</a></span>', $num_widgets), $switch_themes, $num); 388 } else { 389 printf(_n('Theme <span class="b">%1$s</span> with <span class="b">%2$s Widget</span>', 'Theme <span class="b">%1$s</span> with <span class="b">%2$s Widgets</span>', $num_widgets), $switch_themes, $num); 202 } 203 // Comments 204 $num_comm = wp_count_comments(); 205 if ( $num_comm && $num_comm->total_comments ) { 206 $text = _n( 'comment', 'comments', $num_comm->total_comments ); 207 printf( 208 '<li class="comment-count"><a href="edit-comments.php">%1$s %2$s</a></li>', 209 number_format_i18n( $num_comm->total_comments ), 210 $text 211 ); 212 if ( $num_comm->moderated ) { 213 $text = _n( 'in moderation', 'in moderation', $num_comm->total_comments ); 214 printf( 215 '<li class="comment-mod-count"><a href="edit-comments.php?comment_status=moderated">%1$s %2$s</a></li>', 216 number_format_i18n( $num_comm->moderated ), 217 $text 218 ); 390 219 } 391 } else {392 if ( current_user_can( 'switch_themes' ) )393 printf( __('Theme <span class="b"><a href="themes.php">%1$s</a></span>'), $theme->display('Name') );394 else395 printf( __('Theme <span class="b">%1$s</span>'), $theme->display('Name') );396 220 } 397 echo '</p>'; 221 do_action( 'rightnow_list_end' ); 222 ?> 223 </ul> 224 <p><?php printf( __( 'WordPress %1$s running %2$s theme.' ), get_bloginfo( 'version', 'display' ), $theme_name ); ?></p> 225 </div> 398 226 399 // Check if search engines are asked not to index this site. 400 if ( !is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ) { 401 $title = apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') ); 402 $content = apply_filters('privacy_on_link_text', __('Search Engines Discouraged') ); 403 404 echo "<p><a href='options-reading.php' title='$title'>$content</a></p>"; 405 } 406 407 update_right_now_message(); 408 409 echo "\n\t".'<br class="clear" /></div>'; 227 <?php 228 // activity_box_end has a core action, but only prints content when multisite. 229 // Using an output buffer is the only way to really check if anything's displayed here. 230 ob_start(); 410 231 do_action( 'rightnow_end' ); 411 232 do_action( 'activity_box_end' ); 233 $actions = ob_get_clean(); 234 235 if ( !empty( $actions ) ) : ?> 236 <div class="sub"> 237 <?php echo $actions; ?> 238 </div> 239 <?php endif; 412 240 } 413 241 414 242 function wp_network_dashboard_right_now() { … … 458 286 do_action( 'mu_activity_box_end' ); 459 287 } 460 288 461 function wp_dashboard_quick_press() { 289 /** 290 * The Quick Draft widget display and creation of drafts 291 * 292 * 293 * 294 * @since 3.8.0 295 * 296 */ 297 function wp_dashboard_quick_draft( $error_msg=false ) { 462 298 global $post_ID; 463 299 464 $drafts = false;465 if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) && (int) $_POST['post_ID'] ) {466 $view = get_permalink( $_POST['post_ID'] );467 $edit = esc_url( get_edit_post_link( $_POST['post_ID'] ) );468 if ( 'post-quickpress-publish' == $_POST['action'] ) {469 if ( current_user_can('publish_posts') )470 printf( '<div class="updated"><p>' . __( 'Post published. <a href="%s">View post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', esc_url( $view ), $edit );471 else472 printf( '<div class="updated"><p>' . __( 'Post submitted. <a href="%s">Preview post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', esc_url( add_query_arg( 'preview', 1, $view ) ), $edit );473 } else {474 printf( '<div class="updated"><p>' . __( 'Draft saved. <a href="%s">Preview post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', esc_url( add_query_arg( 'preview', 1, $view ) ), $edit );475 $drafts_query = new WP_Query( array(476 'post_type' => 'post',477 'post_status' => 'draft',478 'author' => $GLOBALS['current_user']->ID,479 'posts_per_page' => 1,480 'orderby' => 'modified',481 'order' => 'DESC'482 ) );483 484 if ( $drafts_query->posts )485 $drafts =& $drafts_query->posts;486 }487 printf('<p class="easy-blogging">' . __('You can also try %s, easy blogging from anywhere on the Web.') . '</p>', '<a href="' . esc_url( admin_url( 'tools.php' ) ) . '">' . __('Press This') . '</a>' );488 $_REQUEST = array(); // hack for get_default_post_to_edit()489 }490 491 300 /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */ 492 301 $last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID 493 302 if ( $last_post_id ) { 494 303 $post = get_post( $last_post_id ); 495 304 if ( empty( $post ) || $post->post_status != 'auto-draft' ) { // auto-draft doesn't exists anymore 496 $post = get_default_post_to_edit( 'post', true);305 $post = get_default_post_to_edit( 'post', true ); 497 306 update_user_option( get_current_user_id(), 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID 498 307 } else { 499 308 $post->post_title = ''; // Remove the auto draft title … … 507 316 } 508 317 509 318 $post_ID = (int) $post->ID; 510 511 $media_settings = array( 512 'id' => $post->ID, 513 'nonce' => wp_create_nonce( 'update-post_' . $post->ID ), 514 ); 515 516 if ( current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' ) ) { 517 $featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true ); 518 $media_settings['featuredImageId'] = $featured_image_id ? $featured_image_id : -1; 519 } 319 320 do_action( 'dashboard_quickdraft_beginning', $post ); 520 321 ?> 521 322 522 <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press"> 323 <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form"> 324 325 <?php if ($error_msg) : ?> 326 <div class="error"><?php _e( $error_msg ); ?></div> 327 <?php endif; ?> 328 523 329 <div class="input-text-wrap" id="title-wrap"> 524 <label class="screen-reader-text prompt" for="title" id="title-prompt-text"><?php _e( 'Enter title here'); ?></label>525 <input type="text" name="post_title" id="title" autocomplete="off" value="<?php echo esc_attr( $post->post_title ); ?>"/>330 <label class="screen-reader-text prompt" for="title" id="title-prompt-text"><?php _e( "What's on your mind?" ); ?></label> 331 <input type="text" name="post_title" id="title" autocomplete="off" /> 526 332 </div> 527 333 528 < ?php if ( current_user_can( 'upload_files' ) ) : ?>529 <div id="wp-content-wrap" class="wp-editor-wrap hide-if-no-js wp-media-buttons">530 < ?php do_action( 'media_buttons', 'content' ); ?>334 <div class="textarea-wrap" id="description-wrap"> 335 <label class="screen-reader-text prompt" for="content" id="content-prompt-text"><?php _e( 'Enter a description' ); ?></label> 336 <textarea name="content" id="content" class="mceEditor" rows="3" cols="15"></textarea> 531 337 </div> 532 <?php endif; ?>533 338 534 <div class="textarea-wrap">535 <label class="screen-reader-text" for="content"><?php _e( 'Content' ); ?></label>536 <textarea name="content" id="content" class="mceEditor" rows="3" cols="15"><?php echo esc_textarea( $post->post_content ); ?></textarea>537 </div>538 539 <script type="text/javascript">540 edCanvas = document.getElementById('content');541 edInsertContent = null;542 <?php if ( $_POST ) : ?>543 wp.media.editor.remove('content');544 wp.media.view.settings.post = <?php echo json_encode( $media_settings ); // big juicy hack. ?>;545 wp.media.editor.add('content');546 <?php endif; ?>547 </script>548 549 <div class="input-text-wrap" id="tags-input-wrap">550 <label class="screen-reader-text prompt" for="tags-input" id="tags-input-prompt-text"><?php _e( 'Tags (separate with commas)' ); ?></label>551 <input type="text" name="tags_input" id="tags-input" value="<?php echo get_tags_to_edit( $post->ID ); ?>" />552 </div>553 554 339 <p class="submit"> 555 <span id="publishing-action"> 556 <input type="submit" name="publish" id="publish" accesskey="p" class="button-primary" value="<?php current_user_can('publish_posts') ? esc_attr_e('Publish') : esc_attr_e('Submit for Review'); ?>" /> 557 <span class="spinner"></span> 558 </span> 559 <input type="hidden" name="action" id="quickpost-action" value="post-quickpress-save" /> 340 <input type="hidden" name="action" id="quickpost-action" value="post-quickdraft-save" /> 560 341 <input type="hidden" name="post_ID" value="<?php echo $post_ID; ?>" /> 561 342 <input type="hidden" name="post_type" value="post" /> 562 <?php wp_nonce_field('add-post'); ?> 563 <?php submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post' ) ); ?> 564 <input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" /> 343 <?php wp_nonce_field( 'add-post' ); ?> 344 <?php submit_button( __( 'Save Draft' ), 'primary', 'save', false, array( 'id' => 'save-post' ) ); ?> 565 345 <br class="clear" /> 566 346 </p> 567 347 568 348 </form> 569 349 570 350 <?php 571 if ( $drafts ) 572 wp_dashboard_recent_drafts( $drafts ); 351 wp_dashboard_recent_quickdrafts(); 352 353 do_action( 'dashboard_quickdraft_end' ); 573 354 } 574 355 575 function wp_dashboard_recent_drafts( $drafts = false ) { 576 if ( !$drafts ) { 577 $drafts_query = new WP_Query( array( 578 'post_type' => 'post', 579 'post_status' => 'draft', 580 'author' => $GLOBALS['current_user']->ID, 581 'posts_per_page' => 5, 582 'orderby' => 'modified', 583 'order' => 'DESC' 584 ) ); 585 $drafts =& $drafts_query->posts; 586 } 356 /** 357 * Show `Recent Drafts` below Quick Draft form 358 * 359 * 360 * 361 * @since 3.8.0 362 * 363 */ 364 function wp_dashboard_recent_quickdrafts() { 587 365 366 $query_args = array( 367 'post_type' => 'post', 368 'post_status' => 'draft', 369 'author' => $GLOBALS['current_user']->ID, 370 'posts_per_page' => 4, 371 'orderby' => 'modified', 372 'order' => 'DESC' 373 ); 374 $query_args = apply_filters( 'dash_recent_quickdrafts_query_args', $query_args ); 375 $drafts_query = new WP_Query( $query_args ); 376 $drafts =& $drafts_query->posts; 377 378 588 379 if ( $drafts && is_array( $drafts ) ) { 589 380 $list = array(); 381 $draft_count = 0; 590 382 foreach ( $drafts as $draft ) { 383 if ( 3 == $draft_count ) 384 break; 385 386 $draft_count++; 387 591 388 $url = get_edit_post_link( $draft->ID ); 592 389 $title = _draft_or_post_title( $draft->ID ); 593 $item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';390 $item = '<a href="' . $url . '" title="' . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . '">' . esc_html( $title ) . '</a> <time datetime="' . get_the_time( 'c', $draft) . '">' . get_the_time( get_option( 'date_format' ), $draft ) . '</time>'; 594 391 if ( $the_content = wp_trim_words( $draft->post_content, 10 ) ) 595 392 $item .= '<p>' . $the_content . '</p>'; 596 393 $list[] = $item; 597 394 } 395 396 do_action( 'dashboard_quickdraft_drafts_list', $drafts ); 598 397 ?> 599 <ul> 600 <li><?php echo join( "</li>\n<li>", $list ); ?></li> 601 </ul> 602 <p class="textright"><a href="edit.php?post_status=draft" ><?php _e('View all'); ?></a></p> 603 <?php 604 } else { 605 _e('There are no drafts at the moment'); 606 } 398 <div class="drafts"> 399 <?php if ( 3 < count($drafts) ) { ?> 400 <p class="view-all"><a href="edit.php?post_status=draft" ><?php _e( 'View all' ); ?></a></p> 401 <?php } ?> 402 <h4><?php _e('Drafts'); ?></h4> 403 <ul id="draft-list"> 404 <li><?php echo join( "</li>\n<li>", $list ); ?></li> 405 </ul> 406 </div> 407 <?php } 607 408 } 608 409 609 /**610 * Display recent comments dashboard widget content.611 *612 * @since 2.5.0613 */614 function wp_dashboard_recent_comments() {615 global $wpdb;616 617 // Select all comment types and filter out spam later for better query performance.618 $comments = array();619 $start = 0;620 621 $widgets = get_option( 'dashboard_widget_options' );622 $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] )623 ? absint( $widgets['dashboard_recent_comments']['items'] ) : 5;624 625 $comments_query = array( 'number' => $total_items * 5, 'offset' => 0 );626 if ( ! current_user_can( 'edit_posts' ) )627 $comments_query['status'] = 'approve';628 629 while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {630 foreach ( $possible as $comment ) {631 if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) )632 continue;633 $comments[] = $comment;634 if ( count( $comments ) == $total_items )635 break 2;636 }637 $comments_query['offset'] += $comments_query['number'];638 $comments_query['number'] = $total_items * 10;639 }640 641 if ( $comments ) {642 echo '<div id="the-comment-list" data-wp-lists="list:comment">';643 foreach ( $comments as $comment )644 _wp_dashboard_recent_comments_row( $comment );645 echo '</div>';646 647 if ( current_user_can('edit_posts') )648 _get_list_table('WP_Comments_List_Table')->views();649 650 wp_comment_reply( -1, false, 'dashboard', false );651 wp_comment_trashnotice();652 } else {653 echo '<p>' . __( 'No comments yet.' ) . '</p>';654 }655 }656 657 410 function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { 658 411 $GLOBALS['comment'] =& $comment; 659 412 … … 748 501 } 749 502 750 503 /** 751 * The recent comments dashboard widget control.504 * callback function for `Activity` widget 752 505 * 753 * @since 3.0.0 506 * 507 * 508 * @since 3.8.0 509 * 754 510 */ 755 function wp_dashboard_recent_comments_control() { 756 if ( !$widget_options = get_option( 'dashboard_widget_options' ) ) 757 $widget_options = array(); 511 function wp_dashboard_activity() { 758 512 759 if ( !isset($widget_options['dashboard_recent_comments']) ) 760 $widget_options['dashboard_recent_comments'] = array(); 513 echo '<div id="activity-widget">'; 761 514 762 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-recent-comments']) ) { 763 $number = absint( $_POST['widget-recent-comments']['items'] ); 764 $widget_options['dashboard_recent_comments']['items'] = $number; 765 update_option( 'dashboard_widget_options', $widget_options ); 515 do_action( 'dashboard_activity_beginning' ); 516 517 $future_posts = dashboard_show_published_posts( array( 518 'display' => 2, 519 'max' => 5, 520 'status' => 'future', 521 'order' => 'ASC', 522 'title' => __( 'Publishing Soon' ), 523 'id' => 'future-posts', 524 ) ); 525 $recent_posts = dashboard_show_published_posts( array( 526 'display' => 2, 527 'max' => 5, 528 'status' => 'publish', 529 'order' => 'DESC', 530 'title' => __( 'Recently Published' ), 531 'id' => 'published-posts', 532 ) ); 533 534 do_action( 'dashboard_activity_middle' ); 535 536 $recent_comments = dashboard_comments(); 537 538 if ( !$future_posts && !$recent_posts && !$recent_comments ) { 539 echo '<div class="no-activity">'; 540 echo '<p class="smiley"></p>'; 541 echo '<p>' . __( 'No activity yet!' ) . '</p>'; 542 echo '</div>'; 766 543 } 544 545 do_action( 'dashboard_activity_end' ); 767 546 768 $number = isset( $widget_options['dashboard_recent_comments']['items'] ) ? (int) $widget_options['dashboard_recent_comments']['items'] : ''; 769 770 echo '<p><label for="comments-number">' . __('Number of comments to show:') . '</label>'; 771 echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /></p>'; 547 echo '</div>'; 772 548 } 773 549 774 function wp_dashboard_incoming_links() {775 wp_dashboard_cached_rss_widget( 'dashboard_incoming_links', 'wp_dashboard_incoming_links_output' );776 }777 778 550 /** 779 * Display incoming links dashboard widget content.551 * Generates `Publishing Soon` and `Recently Published` sections 780 552 * 781 * @since 2.5.0 553 * 554 * 555 * @since 3.8.0 556 * 782 557 */ 783 function wp_dashboard_incoming_links_output() { 784 $widgets = get_option( 'dashboard_widget_options' ); 785 @extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP ); 786 $rss = fetch_feed( $url ); 558 function dashboard_show_published_posts( $args ) { 787 559 788 if ( is_wp_error($rss) ) { 789 if ( is_admin() || current_user_can('manage_options') ) { 790 echo '<p>'; 791 printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message()); 792 echo '</p>'; 793 } 794 return; 795 } 560 $query_args = array( 561 'post_type' => 'post', 562 'post_status' => $args['status'], 563 'orderby' => 'date', 564 'order' => $args['order'], 565 'posts_per_page' => intval( $args['max'] ), 566 'no_found_rows' => true, 567 'cache_results' => false 568 ); 569 $query_args = apply_filters( 'dash_show_published_posts_query_args', $query_args ); 570 $posts = new WP_Query( $query_args ); 796 571 797 if ( !$rss->get_item_quantity() ) { 798 echo '<p>' . __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links… yet. It’s okay — there is no rush.') . "</p>\n"; 799 $rss->__destruct(); 800 unset($rss); 801 return; 802 } 572 if ( $posts->have_posts() ) { 803 573 804 echo "<ul>\n";574 echo '<div id="' . $args['id'] . '" class="activity-block">'; 805 575 806 if ( !isset($items) ) 807 $items = 10; 808 809 foreach ( $rss->get_items(0, $items) as $item ) { 810 $publisher = ''; 811 $site_link = ''; 812 $link = ''; 813 $content = ''; 814 $date = ''; 815 $link = esc_url( strip_tags( $item->get_link() ) ); 816 817 $author = $item->get_author(); 818 if ( $author ) { 819 $site_link = esc_url( strip_tags( $author->get_link() ) ); 820 821 if ( !$publisher = esc_html( strip_tags( $author->get_name() ) ) ) 822 $publisher = __( 'Somebody' ); 823 } else { 824 $publisher = __( 'Somebody' ); 576 if ( $posts->post_count > $args['display'] ) { 577 echo '<small class="show-more"><a href="#">' . sprintf( __( 'See %s more…'), $posts->post_count - intval( $args['display'] ) ) . '</a></small>'; 825 578 } 826 if ( $site_link )827 $publisher = "<a href='$site_link'>$publisher</a>";828 else829 $publisher = "<strong>$publisher</strong>";830 579 831 $content = $item->get_content(); 832 $content = wp_html_excerpt( $content, 50, ' …' ); 580 echo '<h4>' . $args['title'] . '</h4>'; 833 581 834 if ( $link ) 835 /* translators: incoming links feed, %1$s is other person, %3$s is content */ 836 $text = __( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"' ); 837 else 838 /* translators: incoming links feed, %1$s is other person, %3$s is content */ 839 $text = __( '%1$s linked here saying, "%3$s"' ); 582 echo '<ul>'; 840 583 841 if ( !empty( $show_date ) ) { 842 if ( $link ) 843 /* translators: incoming links feed, %1$s is other person, %3$s is content, %4$s is the date */ 844 $text = __( '%1$s linked here <a href="%2$s">saying</a>, "%3$s" on %4$s' ); 845 else 846 /* translators: incoming links feed, %1$s is other person, %3$s is content, %4$s is the date */ 847 $text = __( '%1$s linked here saying, "%3$s" on %4$s' ); 848 $date = esc_html( strip_tags( $item->get_date() ) ); 849 $date = strtotime( $date ); 850 $date = gmdate( get_option( 'date_format' ), $date ); 584 $i = 0; 585 while ( $posts->have_posts() ) { 586 $posts->the_post(); 587 printf( 588 '<li%s><span>%s, %s</span> <a href="%s">%s</a></li>', 589 ( $i >= intval ( $args['display'] ) ? ' class="hidden"' : '' ), 590 dashboard_relative_date( get_the_time( 'U' ) ), 591 get_the_time(), 592 get_edit_post_link(), 593 get_the_title() 594 ); 595 $i++; 851 596 } 852 597 853 echo "\t<li>" . sprintf( $text, $publisher, $link, $content, $date ) . "</li>\n"; 598 echo '</ul>'; 599 echo '</div>'; 600 601 } else { 602 return false; 854 603 } 855 604 856 echo "</ul>\n"; 857 $rss->__destruct(); 858 unset($rss); 859 } 605 wp_reset_postdata(); 860 606 861 function wp_dashboard_incoming_links_control() { 862 wp_dashboard_rss_control( 'dashboard_incoming_links', array( 'title' => false, 'show_summary' => false, 'show_author' => false ) ); 607 return true; 863 608 } 864 609 865 function wp_dashboard_primary() {866 wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' );867 }868 869 function wp_dashboard_primary_control() {870 wp_dashboard_rss_control( 'dashboard_primary' );871 }872 873 610 /** 874 * Display primary dashboard RSS widget feed.611 * Show `Comments` section 875 612 * 876 * @since 2.5.0877 613 * 878 * @param string $widget_id879 */880 function wp_dashboard_rss_output( $widget_id ) {881 $widgets = get_option( 'dashboard_widget_options' );882 echo '<div class="rss-widget">';883 wp_widget_rss_output( $widgets[$widget_id] );884 echo "</div>";885 }886 887 function wp_dashboard_secondary() {888 wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' );889 }890 891 function wp_dashboard_secondary_control() {892 wp_dashboard_rss_control( 'dashboard_secondary' );893 }894 895 /**896 * Display secondary dashboard RSS widget feed.897 614 * 898 * @since 2.5.0615 * @since 3.8.0 899 616 * 900 * @return unknown901 617 */ 902 function wp_dashboard_secondary_output() { 903 $widgets = get_option( 'dashboard_widget_options' ); 904 @extract( @$widgets['dashboard_secondary'], EXTR_SKIP ); 905 $rss = @fetch_feed( $url ); 618 function dashboard_comments( $total_items = 5 ) { 619 global $wpdb; 906 620 907 if ( is_wp_error($rss) ) { 908 if ( is_admin() || current_user_can('manage_options') ) { 909 echo '<div class="rss-widget"><p>'; 910 printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message()); 911 echo '</p></div>'; 621 // Select all comment types and filter out spam later for better query performance. 622 $comments = array(); 623 $start = 0; 624 625 $comments_query = array( 626 'number' => $total_items * 5, 627 'offset' => 0 628 ); 629 if ( ! current_user_can( 'edit_posts' ) ) 630 $comments_query['status'] = 'approve'; 631 632 while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) { 633 foreach ( $possible as $comment ) { 634 if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) ) 635 continue; 636 $comments[] = $comment; 637 if ( count( $comments ) == $total_items ) 638 break 2; 912 639 } 913 } elseif ( !$rss->get_item_quantity() ) { 914 $rss->__destruct(); 915 unset($rss); 916 return false; 917 } else { 918 echo '<div class="rss-widget">'; 919 wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] ); 640 $comments_query['offset'] += $comments_query['number']; 641 $comments_query['number'] = $total_items * 10; 642 } 643 644 645 646 if ( $comments ) { 647 echo '<div id="latest-comments" class="activity-block">'; 648 echo '<h4>' . __( 'Comments' ) . '</h4>'; 649 650 echo '<div id="the-comment-list" data-wp-lists="list:comment">'; 651 foreach ( $comments as $comment ) 652 _wp_dashboard_recent_comments_row( $comment ); 920 653 echo '</div>'; 921 $rss->__destruct(); 922 unset($rss); 654 655 if ( current_user_can('edit_posts') ) 656 _get_list_table('WP_Comments_List_Table')->views(); 657 658 wp_comment_reply( -1, false, 'dashboard', false ); 659 wp_comment_trashnotice(); 660 661 echo '</div>'; 662 } else { 663 return false; 923 664 } 665 return true; 924 666 } 925 667 926 function wp_dashboard_plugins() {927 wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(928 'http://wordpress.org/plugins/rss/browse/popular/',929 'http://wordpress.org/plugins/rss/browse/new/'930 ) );931 }932 933 668 /** 934 * Display plugins most popular, newest plugins, and recently updated widget text.669 * return relative date for given timestamp 935 670 * 936 * @since 2.5.0 671 * 672 * 673 * @since 3.8.0 674 * 937 675 */ 938 function wp_dashboard_plugins_output() { 939 $popular = fetch_feed( 'http://wordpress.org/plugins/rss/browse/popular/' ); 940 $new = fetch_feed( 'http://wordpress.org/plugins/rss/browse/new/' ); 676 function dashboard_relative_date( $time ) { 941 677 942 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { 943 $plugin_slugs = array_keys( get_plugins() ); 944 set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS ); 945 } 678 $diff = floor( ( $time - time() ) / DAY_IN_SECONDS ); 946 679 947 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins') ) as $feed => $label ) { 948 if ( is_wp_error($$feed) || !$$feed->get_item_quantity() ) 949 continue; 680 if ( $diff == 0 ) 681 return __( 'Today' ); 950 682 951 $items = $$feed->get_items(0, 5); 683 if ( $diff == 1 ) 684 return __( 'Tomorrow' ); 952 685 953 // Pick a random, non-installed plugin 954 while ( true ) { 955 // Abort this foreach loop iteration if there's no plugins left of this type 956 if ( 0 == count($items) ) 957 continue 2; 686 return date( 'M jS', $time); 958 687 959 $item_key = array_rand($items);960 $item = $items[$item_key];961 962 list($link, $frag) = explode( '#', $item->get_link() );963 964 $link = esc_url($link);965 if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )966 $slug = $matches[1];967 else {968 unset( $items[$item_key] );969 continue;970 }971 972 // Is this random plugin's slug already installed? If so, try again.973 reset( $plugin_slugs );974 foreach ( $plugin_slugs as $plugin_slug ) {975 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {976 unset( $items[$item_key] );977 continue 2;978 }979 }980 981 // If we get to this point, then the random plugin isn't installed and we can stop the while().982 break;983 }984 985 // Eliminate some common badly formed plugin descriptions986 while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )987 unset($items[$item_key]);988 989 if ( !isset($items[$item_key]) )990 continue;991 992 $title = esc_html( $item->get_title() );993 994 $description = esc_html( strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) );995 996 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) .997 '&TB_iframe=true&width=600&height=800';998 999 echo "<h4>$label</h4>\n";1000 echo "<h5><a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";1001 echo "<p>$description</p>\n";1002 1003 $$feed->__destruct();1004 unset($$feed);1005 }1006 688 } 1007 689 1008 690 /** … … 1074 756 } 1075 757 1076 758 /** 1077 * The RSS dashboard widget control.759 * Returns default WordPress News feeds 1078 760 * 1079 * Sets up $args to be used as input to wp_widget_rss_form(). Handles POST data1080 * from RSS-type widgets.1081 761 * 1082 * @since 2.5.01083 762 * 1084 * @ param string $widget_id1085 * @param array $form_inputs763 * @since 3.8.0 764 * 1086 765 */ 1087 function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) { 1088 if ( !$widget_options = get_option( 'dashboard_widget_options' ) ) 766 function wp_dashboard_default_feeds() { 767 return array( 768 'news' => array( 769 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ), 770 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ), 771 'title' => '', 772 'items' => 1, 773 'show_summary' => 1, 774 'show_author' => 0, 775 'show_date' => 1, 776 ), 777 'planet' => array( 778 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ), 779 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ), 780 'title' => '', 781 'items' => 3, 782 'show_summary' => 0, 783 'show_author' => 0, 784 'show_date' => 0, 785 ), 786 'plugins' => array( 787 'link' => '', 788 'url' => array( 789 'popular' => 'http://wordpress.org/plugins/rss/browse/popular/', 790 'new' => 'http://wordpress.org/plugins/rss/browse/new/' 791 ), 792 'title' => '', 793 'items' => 1, 794 'show_summary' => 0, 795 'show_author' => 0, 796 'show_date' => 0, 797 ) 798 ); 799 } 800 801 /** 802 * Check for cached feeds 803 * 804 * 805 * 806 * @since 3.8.0 807 * 808 */ 809 function wp_dashboard_rss() { 810 $default_feeds = wp_dashboard_default_feeds(); 811 812 $widget_options = get_option( 'dashboard_widget_options' ); 813 814 if ( !$widget_options || !is_array($widget_options) ) 1089 815 $widget_options = array(); 1090 816 1091 if ( !isset($widget_options[$widget_id]) ) 1092 $widget_options[$widget_id] = array(); 817 if ( ! isset( $widget_options['dashboard_rss'] ) ) { 818 $widget_options['dashboard_rss'] = $default_feeds; 819 update_option( 'dashboard_widget_options', $widget_options ); 820 } 1093 821 1094 $number = 1; // Hack to use wp_widget_rss_form() 1095 $widget_options[$widget_id]['number'] = $number; 822 foreach( $default_feeds as $key => $value ) { 823 $default_urls[] = $value['url']; 824 } 825 826 do_action( 'dashboard_news_beginning' ); 1096 827 1097 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) { 1098 $_POST['widget-rss'][$number] = wp_unslash( $_POST['widget-rss'][$number] ); 1099 $widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] ); 1100 $widget_options[$widget_id]['number'] = $number; 1101 // title is optional. If black, fill it if possible 1102 if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) { 1103 $rss = fetch_feed($widget_options[$widget_id]['url']); 1104 if ( is_wp_error($rss) ) { 1105 $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed')); 1106 } else { 1107 $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title())); 1108 $rss->__destruct(); 1109 unset($rss); 828 wp_dashboard_cached_rss_widget( 'dashboard_rss', 'wp_dashboard_news_output', $default_urls ); 829 830 do_action( 'dashboard_news_end' ); 831 } 832 833 /** 834 * Display news feeds 835 * 836 * 837 * 838 * @since 3.8.0 839 * 840 */ 841 function wp_dashboard_news_output() { 842 $widgets = get_option( 'dashboard_widget_options' ); 843 844 foreach( $widgets['dashboard_rss'] as $type => $args ) { 845 $args['type'] = $type; 846 echo '<div class="rss-widget">'; 847 wp_widget_news_output( $args['url'], $args ); 848 echo "</div>"; 849 } 850 } 851 852 /** 853 * Generate code for each news feed 854 * 855 * 856 * 857 * @since 3.8.0 858 * 859 */ 860 function wp_widget_news_output( $rss, $args = array() ) { 861 862 // Regular RSS feeds 863 if ( isset( $args['type'] ) && 'plugins' != $args['type'] ) 864 return wp_widget_rss_output( $rss, $args ); 865 866 // Plugin feeds plus link to install them 867 if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) { 868 $popular = fetch_feed( $args['url']['popular'] ); 869 $new = fetch_feed( $args['url']['new'] ); 870 871 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { 872 $plugin_slugs = array_keys( get_plugins() ); 873 set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS ); 874 } 875 876 echo '<ul>'; 877 878 foreach ( array( 879 'popular' => __( 'Popular Plugin' ), 880 'new' => __( 'Newest Plugin' ) 881 ) as $feed => $label ) { 882 if ( is_wp_error($$feed) || !$$feed->get_item_quantity() ) 883 continue; 884 885 $items = $$feed->get_items(0, 5); 886 887 // Pick a random, non-installed plugin 888 while ( true ) { 889 // Abort this foreach loop iteration if there's no plugins left of this type 890 if ( 0 == count($items) ) 891 continue 2; 892 893 $item_key = array_rand($items); 894 $item = $items[$item_key]; 895 896 list($link, $frag) = explode( '#', $item->get_link() ); 897 898 $link = esc_url($link); 899 if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) ) 900 $slug = $matches[1]; 901 else { 902 unset( $items[$item_key] ); 903 continue; 904 } 905 906 // Is this random plugin's slug already installed? If so, try again. 907 reset( $plugin_slugs ); 908 foreach ( $plugin_slugs as $plugin_slug ) { 909 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) { 910 unset( $items[$item_key] ); 911 continue 2; 912 } 913 } 914 915 // If we get to this point, then the random plugin isn't installed and we can stop the while(). 916 break; 1110 917 } 918 919 // Eliminate some common badly formed plugin descriptions 920 while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) ) 921 unset($items[$item_key]); 922 923 if ( !isset($items[$item_key]) ) 924 continue; 925 926 $title = esc_html( $item->get_title() ); 927 928 $description = esc_html( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ) ) ); 929 930 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&TB_iframe=true&width=600&height=800'; 931 932 echo "<li><span>$label:</span> <a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span></li>"; 933 934 $$feed->__destruct(); 935 unset( $$feed ); 1111 936 } 1112 update_option( 'dashboard_widget_options', $widget_options ); 1113 $cache_key = 'dash_' . md5( $widget_id ); 1114 delete_transient( $cache_key ); 937 938 echo '</ul>'; 1115 939 } 1116 1117 wp_widget_rss_form( $widget_options[$widget_id], $form_inputs );1118 940 } 1119 941 1120 942 /** … … 1127 949 * @return bool True if not multisite, user can't upload files, or the space check option is disabled. 1128 950 */ 1129 951 function wp_dashboard_quota() { 1130 if ( !is_multisite() || !current_user_can( 'upload_files') || get_site_option( 'upload_space_check_disabled' ) )952 if ( !is_multisite() || !current_user_can( 'upload_files' ) || get_site_option( 'upload_space_check_disabled' ) ) 1131 953 return true; 1132 954 1133 955 $quota = get_space_allowed(); … … 1137 959 $percentused = '100'; 1138 960 else 1139 961 $percentused = ( $used / $quota ) * 100; 1140 $used_c olor = ( $percentused >= 70 ) ? ' spam' : '';962 $used_class = ( $percentused >= 70 ) ? ' warning' : ''; 1141 963 $used = round( $used, 2 ); 1142 964 $percentused = number_format( $percentused ); 1143 965 1144 966 ?> 1145 <p class="sub musub"><?php _e( 'Storage Space' ); ?></p> 1146 <div class="table table_content musubtable"> 1147 <table> 1148 <tr class="first"> 1149 <td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'upload.php' ) ), number_format_i18n( $quota ) ); ?></td> 1150 <td class="t posts"><?php _e( 'Space Allowed' ); ?></td> 1151 </tr> 1152 </table> 967 <h4 class="mu-storage"><?php _e( 'Storage Space' ); ?></h4> 968 <div class="mu-storage"> 969 <ul> 970 <li class="storage-count"> 971 <?php printf( 972 '<a href="%1$s" title="%3$s">%2$sMB %4$s</a>', 973 esc_url( admin_url( 'upload.php' ) ), 974 number_format_i18n( $quota ), 975 __( 'Manage Uploads' ), 976 __( 'Space Allowed' ) 977 ); ?> 978 </li><li class="storage-count <?php echo $used_class; ?>"> 979 <?php printf( 980 '<a href="%1$s" title="%4$s" class="musublink">%2$sMB (%3$s%%) %5$s</a>', 981 esc_url( admin_url( 'upload.php' ) ), 982 number_format_i18n( $used, 2 ), 983 $percentused, 984 __( 'Manage Uploads' ), 985 __( 'Space Used' ) 986 ); ?> 987 </li> 988 </ul> 1153 989 </div> 1154 <div class="table table_discussion musubtable">1155 <table>1156 <tr class="first">1157 <td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'upload.php' ) ), number_format_i18n( $used, 2 ), $percentused ); ?></td>1158 <td class="last t comments<?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>1159 </tr>1160 </table>1161 </div>1162 <br class="clear" />1163 990 <?php 1164 991 } 1165 992 add_action( 'activity_box_end', 'wp_dashboard_quota' ); -
wp-admin/includes/deprecated.php
730 730 */ 731 731 function wp_dashboard_quick_press_output() { 732 732 _deprecated_function( __FUNCTION__, '3.2', 'wp_dashboard_quick_press()' ); 733 wp_dashboard_quick_ press();733 wp_dashboard_quick_draft(); 734 734 } 735 735 736 736 /** -
wp-admin/post.php
66 66 $location = add_query_arg( 'message', 3, wp_get_referer() ); 67 67 $location = explode('#', $location); 68 68 $location = $location[0] . '#postcustom'; 69 } elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) {70 $location = "post.php?action=edit&post=$post_id&message=7";71 69 } else { 72 70 $location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) ); 73 71 } … … 96 94 } 97 95 98 96 switch($action) { 97 case 'post-quickdraft-save': 98 // Check nonce and capabilities 99 $nonce = $_REQUEST['_wpnonce']; 100 $error_msg = false; 101 if ( ! wp_verify_nonce( $nonce, 'add-post' ) ) 102 $error_msg = 'Unable to submit this form, please refresh and try again.'; 103 104 if ( ! current_user_can( 'edit_posts' ) ) 105 $error_msg = "Oops, you don't have access to add new drafts."; 106 107 if ( $error_msg ) 108 return wp_dashboard_quick_draft( $error_msg ); 109 110 $post = get_post( $_REQUEST['post_ID'] ); 111 check_admin_referer( 'add-' . $post->post_type ); 112 edit_post(); 113 // output the quickdraft dashboard widget 114 require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); 115 wp_dashboard_quick_draft(); 116 exit; 117 break; 118 99 119 case 'postajaxpost': 100 120 case 'post': 101 case 'post-quickpress-publish': 102 case 'post-quickpress-save': 103 check_admin_referer('add-' . $post_type); 121 // Check nonce and capabilities 122 $nonce = $_REQUEST['_wpnonce']; 123 $error_msg = false; 124 if ( ! wp_verify_nonce( $nonce, 'add-post' ) ) 125 $error_msg = 'Unable to submit this form, please refresh and try again.'; 126 127 if ( ! current_user_can( 'edit_posts' ) ) 128 $error_msg = "Oops, you don't have access to add new drafts."; 104 129 105 if ( 'post-quickpress-publish' == $action ) 106 $_POST['publish'] = 'publish'; // tell write_post() to publish 130 $post_id = 'postajaxpost' == $action ? edit_post() : write_post(); 107 131 108 if ( 'post-quickpress-publish' == $action || 'post-quickpress-save' == $action ) {109 $_POST['comment_status'] = get_option('default_comment_status');110 $_POST['ping_status'] = get_option('default_ping_status');111 $post_id = edit_post();112 } else {113 $post_id = 'postajaxpost' == $action ? edit_post() : write_post();114 }115 116 if ( 0 === strpos( $action, 'post-quickpress' ) ) {117 $_POST['post_ID'] = $post_id;118 // output the quickpress dashboard widget119 require_once(ABSPATH . 'wp-admin/includes/dashboard.php');120 wp_dashboard_quick_press();121 exit;122 }123 124 132 redirect_post($post_id); 125 133 exit(); 126 134 break; -
wp-admin/js/dashboard.js
29 29 30 30 // These widgets are sometimes populated via ajax 31 31 ajaxWidgets = [ 32 'dashboard_incoming_links', 33 'dashboard_primary', 34 'dashboard_secondary', 35 'dashboard_plugins' 32 'dashboard_rss' 36 33 ]; 37 34 38 35 ajaxPopulateWidgets = function(el) { … … 61 58 ajaxPopulateWidgets(); 62 59 63 60 postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } ); 64 61 65 62 /* QuickPress */ 66 63 quickPressLoad = function() { 67 64 var act = $('#quickpost-action'), t; 68 65 t = $('#quick-press').submit( function() { 69 $('#dashboard_quick_ press#publishing-action .spinner').show();66 $('#dashboard_quick_draft #publishing-action .spinner').show(); 70 67 $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', true); 71 68 72 if ( 'post' == act.val() ) { 73 act.val( 'post-quickpress-publish' ); 69 $.post( t.attr( 'action' ), t.serializeArray(), function( data ) { 70 // Replace the form, and prepend the published post. 71 $('#dashboard_quick_draft .inside').html( data ); 72 $('#quick-press').removeClass('initial-form'); 73 quickPressLoad(); 74 highlightLatestPost(); 75 $('#title').focus(); 76 }); 77 78 function highlightLatestPost () { 79 var latestPost = $('#draft-list li').first(); 80 latestPost.css('background', '#fffbe5'); 81 setTimeout(function () { 82 latestPost.css('background', 'none'); 83 }, 1000); 74 84 } 75 76 $('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() { 77 $('#dashboard_quick_press #publishing-action .spinner').hide(); 78 $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', false); 79 $('#dashboard_quick_press ul').next('p').remove(); 80 $('#dashboard_quick_press ul').find('li').each( function() { 81 $('#dashboard_recent_drafts ul').prepend( this ); 82 } ).end().remove(); 83 quickPressLoad(); 84 } ); 85 85 86 return false; 86 87 } ); 87 88 88 89 $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } ); 89 90 90 $('#title, #tags-input ').each( function() {91 $('#title, #tags-input, #content').each( function() { 91 92 var input = $(this), prompt = $('#' + this.id + '-prompt-text'); 92 93 93 94 if ( '' === this.value ) … … 109 110 }); 110 111 111 112 $('#quick-press').on( 'click focusin', function() { 113 $(this).addClass("quickpress-open"); 114 $("#description-wrap, p.submit").slideDown(200); 112 115 wpActiveEditor = 'content'; 113 116 }); 114 117 }; 115 118 quickPressLoad(); 119 120 // Activity Widget 121 $( '.show-more a' ).on( 'click', function(e) { 122 $( this ).fadeOut().closest('.activity-block').find( 'li.hidden' ).fadeIn().removeClass( 'hidden' ); 123 e.preventDefault(); 124 }) 116 125 117 126 } ); -
wp-admin/js/plugin-install.js
27 27 28 28 $(window).resize(function(){ tb_position(); }); 29 29 30 $(' #dashboard_plugins,.plugins').on( 'click', 'a.thickbox', function() {30 $('.plugins').on( 'click', 'a.thickbox', function() { 31 31 tb_click.call(this); 32 32 33 33 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); -
wp-admin/css/ie-rtl.css
86 86 margin-right: 335px !important; 87 87 } 88 88 89 #dashboard_plugins {90 direction: ltr;91 }92 93 #dashboard_plugins h3.hndle {94 direction: rtl;95 }96 97 #dashboard_incoming_links ul li,98 #dashboard_secondary ul li,99 #dashboard_primary ul li,100 89 p.row-actions { 101 90 width: 100%; 102 91 } -
wp-admin/css/ie.css
141 141 overflow: visible; 142 142 } 143 143 144 #dashboard-widgets #dashboard_quick_press form p.submit #publish {145 float: none;146 }147 148 144 #dashboard-widgets h3 a { 149 145 height: 14px; 150 146 line-height: 14px; -
wp-admin/css/colors-fresh.css
376 376 color: #d54e21; 377 377 } 378 378 379 #the-comment-list .comment-item, 380 #dashboard-widgets #dashboard_quick_press form p.submit { 379 #the-comment-list .comment-item { 381 380 border-color: #dfdfdf; 382 381 } 383 382 … … 552 551 border-color: #666; 553 552 } 554 553 555 #dashboard_secondary div.dashboard-widget-content ul li a {556 background-color: #f9f9f9;557 }558 559 554 input.readonly, textarea.readonly { 560 555 background-color: #ddd; 561 556 } … … 640 635 641 636 table.widefat span.delete a, 642 637 table.widefat span.trash a, 643 table.widefat span.spam a, 644 #dashboard_recent_comments .delete a, 645 #dashboard_recent_comments .trash a, 646 #dashboard_recent_comments .spam a { 638 table.widefat span.spam a { 647 639 color: #bc0b0b; 648 640 } 649 641 … … 816 808 .widget-control-remove:hover, 817 809 table.widefat .delete a:hover, 818 810 table.widefat .trash a:hover, 819 table.widefat .spam a:hover, 820 #dashboard_recent_comments .delete a:hover, 821 #dashboard_recent_comments .trash a:hover 822 #dashboard_recent_comments .spam a:hover { 811 table.widefat .spam a:hover { 823 812 color: #f00; 824 813 } 825 814 … … 1672 1661 opacity: 0.5; 1673 1662 } 1674 1663 1675 #dashboard_recent_comments div.undo {1676 border-top-color: #dfdfdf;1677 }1678 1679 1664 .comment-ays, 1680 1665 .comment-ays th { 1681 1666 border-color: #ddd; -
wp-admin/css/wp-admin-rtl.css
2094 2094 #dashboard_right_now p.sub, 2095 2095 #dashboard-widgets h4, 2096 2096 a.rsswidget, 2097 #dashboard_plugins h4,2098 #dashboard_plugins h5,2099 #dashboard_recent_comments .comment-meta .approve,2100 2097 #dashboard_right_now td.b, 2101 2098 #dashboard_right_now .versions a { 2102 2099 font-family: Tahoma, Arial, sans-serif; … … 2131 2128 clear: left; 2132 2129 } 2133 2130 2134 #dashboard_plugins .inside span {2135 padding-left: 0;2136 padding-right: 5px;2137 }2138 2139 2131 #dashboard-widgets h3 .postbox-title-action { 2140 2132 right: auto; 2141 2133 left: 10px; … … 2173 2165 margin-right: 3px; 2174 2166 } 2175 2167 2176 /* QuickPress */2177 #dashboard-widgets #dashboard_quick_press form p.submit input {2178 float: right;2179 }2180 2181 #dashboard-widgets #dashboard_quick_press form p.submit #save-post {2182 margin: 0 1px 0 0.7em;2183 }2184 2185 #dashboard-widgets #dashboard_quick_press form p.submit #publish {2186 float: left;2187 }2188 2189 #dashboard-widgets #dashboard_quick_press form p.submit .spinner {2190 margin: 4px 0 0 6px;2191 }2192 2193 /* Recent Drafts */2194 #dashboard_recent_drafts h4 abbr {2195 font-family: Tahoma, Arial, sans-serif;2196 margin-left:0;2197 margin-right: 3px;2198 }2199 2200 2168 /* login */ 2201 2169 body.login { 2202 2170 font-family: Tahoma, Arial, sans-serif; … … 2867 2835 .locale-he-il #dashboard_right_now p.sub, 2868 2836 .locale-he-il #dashboard-widgets h4, 2869 2837 .locale-he-il a.rsswidget, 2870 .locale-he-il #dashboard_plugins h4,2871 .locale-he-il #dashboard_plugins h5,2872 .locale-he-il #dashboard_recent_comments .comment-meta .approve,2873 2838 .locale-he-il #dashboard_right_now td.b, 2874 2839 .locale-he-il #dashboard_right_now .versions a, 2875 2840 .locale-he-il .rss-widget span.rss-date, 2876 .locale-he-il #dashboard_recent_drafts h4 abbr,2877 2841 body.login.locale-he-il, 2878 2842 .locale-he-il #login form .submit input, 2879 2843 .locale-he-il #menu-management .nav-tabs-arrow-right, -
wp-admin/css/wp-admin.css
763 763 764 764 div.sidebar-name h3, 765 765 #menu-management .nav-tab, 766 #dashboard_plugins h5,767 766 a.rsswidget, 768 767 #dashboard_right_now td.b, 769 768 #dashboard-widgets h4, … … 2228 2227 margin: 0 8px; 2229 2228 } 2230 2229 2231 #dashboard_recent_comments div.undo {2232 border-top-style: solid;2233 border-top-width: 1px;2234 margin: 0 -10px;2235 padding: 3px 8px;2236 font-size: 11px;2237 }2238 2239 2230 #the-comment-list td.comment p.comment-author { 2240 2231 margin-top: 0; 2241 2232 margin-left: 0; … … 6855 6846 } 6856 6847 6857 6848 /* Recent Comments */ 6858 #dashboard_recent_comments h3 {6859 margin-bottom: 0;6860 }6861 6862 #dashboard_recent_comments .inside {6863 margin-top: 0;6864 }6865 6866 #dashboard_recent_comments .comment-meta .approve {6867 font-style: italic;6868 font-family: sans-serif;6869 font-size: 10px;6870 }6871 6872 #dashboard_recent_comments .subsubsub {6873 float: none;6874 white-space: normal;6875 }6876 6877 6849 #the-comment-list { 6878 6850 position: relative; 6879 6851 } … … 6919 6891 display: inline; 6920 6892 } 6921 6893 6922 #dashboard_recent_comments #the-comment-list .trackback blockquote,6923 #dashboard_recent_comments #the-comment-list .pingback blockquote {6924 display: block;6925 }6926 6927 6894 #the-comment-list .comment-item p.row-actions { 6928 6895 margin: 3px 0 0; 6929 6896 padding: 0; 6930 6897 font-size: 12px; 6931 6898 } 6932 6899 6933 /* QuickPress */6934 .no-js #dashboard_quick_press {6935 display: none;6936 }6937 6938 #dashboard_quick_press .easy-blogging {6939 padding: 0 8px;6940 text-align: left;6941 }6942 6943 #dashboard_quick_press .input-text-wrap {6944 position: relative;6945 }6946 6947 #dashboard_quick_press .prompt {6948 color: #bbb;6949 position: absolute;6950 }6951 6952 #dashboard_quick_press div.updated {6953 padding: 0 5px;6954 }6955 6956 6900 #title-wrap label, 6957 6901 #tags-input-wrap label { 6958 6902 cursor: text; … … 6979 6923 padding: 4px 8px; 6980 6924 } 6981 6925 6982 #dashboard_quick_press .input-text-wrap,6983 #dashboard_quick_press .textarea-wrap {6984 margin: 0 0 1em 0;6985 }6986 6987 #dashboard_quick_press .wp-media-buttons {6988 margin: 0 0 .2em 1px;6989 padding: 0;6990 }6991 6992 #dashboard_quick_press .wp-media-buttons a {6993 color: #777;6994 }6995 6996 #dashboard-widgets #dashboard_quick_press form p.submit input {6997 float: left;6998 }6999 7000 #dashboard-widgets #dashboard_quick_press form p.submit #save-post {7001 margin: 0 0.7em 0 1px;7002 }7003 7004 #dashboard-widgets #dashboard_quick_press form p.submit #publish {7005 float: right;7006 }7007 7008 #dashboard-widgets #dashboard_quick_press form p.submit .spinner {7009 vertical-align: middle;7010 margin: 4px 6px 0 0;7011 }7012 7013 /* Recent Drafts */7014 #dashboard_recent_drafts ul,7015 #dashboard_recent_drafts p {7016 margin: 0;7017 padding: 0;7018 word-wrap: break-word;7019 }7020 7021 #dashboard_recent_drafts ul {7022 list-style: none;7023 }7024 7025 #dashboard_recent_drafts ul li {7026 margin-bottom: 1em;7027 }7028 7029 #dashboard_recent_drafts h4 {7030 line-height: 1.7em;7031 word-wrap: break-word;7032 }7033 7034 #dashboard_recent_drafts h4 abbr {7035 font-weight: normal;7036 font-family: sans-serif;7037 font-size: 12px;7038 color: #999;7039 margin-left: 3px;7040 }7041 7042 6926 /* Feeds */ 7043 6927 .rss-widget ul { 7044 6928 margin: 0; … … 7073 6957 content: '\2014'; 7074 6958 } 7075 6959 7076 /* Plugins */7077 #dashboard_plugins h4 {7078 line-height: 1.7em;7079 }7080 7081 #dashboard_plugins h5 {7082 font-weight: normal;7083 font-size: 13px;7084 margin: 0;7085 display: inline;7086 line-height: 1.4em;7087 }7088 7089 #dashboard_plugins h5 a {7090 line-height: 1.4em;7091 }7092 7093 #dashboard_plugins .inside span {7094 font-size: 12px;7095 padding-left: 5px;7096 }7097 7098 #dashboard_plugins p {7099 margin: 0.3em 0 1.4em;7100 line-height: 1.4em;7101 }7102 7103 6960 .dashboard-comment-wrap { 7104 6961 overflow: hidden; 7105 6962 word-wrap: break-word; -
wp-admin/css/colors-classic.css
375 375 color: #d54e21; 376 376 } 377 377 378 #the-comment-list .comment-item, 379 #dashboard-widgets #dashboard_quick_press form p.submit { 378 #the-comment-list .comment-item { 380 379 border-color: #dfdfdf; 381 380 } 382 381 … … 550 549 border-color: #666; 551 550 } 552 551 553 #dashboard_secondary div.dashboard-widget-content ul li a {554 background-color: #f9f9f9;555 }556 557 552 input.readonly, textarea.readonly { 558 553 background-color: #ddd; 559 554 } … … 638 633 639 634 table.widefat span.delete a, 640 635 table.widefat span.trash a, 641 table.widefat span.spam a, 642 #dashboard_recent_comments .delete a, 643 #dashboard_recent_comments .trash a, 644 #dashboard_recent_comments .spam a { 636 table.widefat span.spam a { 645 637 color: #bc0b0b; 646 638 } 647 639 … … 820 812 .widget-control-remove:hover, 821 813 table.widefat .delete a:hover, 822 814 table.widefat .trash a:hover, 823 table.widefat .spam a:hover, 824 #dashboard_recent_comments .delete a:hover, 825 #dashboard_recent_comments .trash a:hover 826 #dashboard_recent_comments .spam a:hover { 815 table.widefat .spam a:hover { 827 816 color: #f00; 828 817 } 829 818 … … 1781 1770 opacity: 0.5; 1782 1771 } 1783 1772 1784 #dashboard_recent_comments div.undo {1785 border-top-color: #dfdfdf;1786 }1787 1788 1773 .comment-ays, 1789 1774 .comment-ays th { 1790 1775 border-color: #ddd; -
wp-admin/css/temporary-dash-styles.css
1 /* Dashboard WordPress news */ 2 3 #dashboard_rss .inside { 4 margin: 0; 5 padding: 0; 6 } 7 8 #dashboard_rss .widget-loading, 9 #dashboard_rss .dashboard-widget-control-form { 10 padding: 12px 12px 0; 11 } 12 13 body #dashboard-widgets .postbox form .submit { 14 margin: 0; 15 } 16 17 .dashboard-widget-control-form { 18 overflow: hidden; 19 } 20 21 .dashboard-widget-control-form p { 22 margin-top: 0; 23 } 24 25 .rssSummary { 26 color: #999; 27 margin-top: 4px; 28 } 29 30 .rss-widget { 31 border-bottom: 1px solid #eee; 32 font-size: 13px; 33 padding: 8px 12px 12px; 34 } 35 36 .rss-widget:last-child { 37 border-bottom: none; 38 padding-bottom: 0; 39 } 40 41 .rss-widget a { 42 font-weight: normal; 43 } 44 45 .rss-widget span, 46 .rss-widget span.rss-date { 47 color: #bbb; 48 } 49 50 .rss-widget span.rss-date { 51 margin-left: 12px; 52 } 53 54 .rss-widget ul li { 55 margin-bottom: 8px; 56 } 57 58 /* Dashboard right now */ 59 60 #dash-right-now ul { 61 margin: 0; 62 overflow: hidden; 63 } 64 65 #dash-right-now li { 66 width: 50%; 67 float: left; 68 margin-bottom: 10px; 69 } 70 71 #dash-right-now .inside { 72 margin-bottom: 0; 73 overflow: hidden; 74 padding: 0; 75 } 76 77 #dash-right-now .main { 78 padding: 0 12px; 79 } 80 81 #dash-right-now .main p { 82 margin: 0; 83 } 84 85 .mu-storage { 86 overflow: hidden; 87 } 88 89 /* Dashboard right now - Colors */ 90 91 #dash-right-now li a:before { 92 color: #888; 93 } 94 95 #dash-right-now .sub { 96 color: #bfbbbb; 97 background: #f5f5f5; 98 border-top-color: #dedede; 99 padding: 12px 12px 6px 12px; 100 border-top: 1px solid; 101 } 102 103 #dash-right-now .sub h4 { 104 color: #555; 105 } 106 107 #dash-right-now .sub p { 108 margin: 0 0 .5em; 109 font-size: 11px; 110 } 111 112 #dash-right-now .warning a:before { 113 color: #d54e21; 114 } 115 116 /* Dashboard right now - Icons */ 117 #dash-right-now li a:before { 118 content: '\f159'; 119 font: normal 20px/1 'dashicons'; 120 speak: none; 121 display: block; 122 float: left; 123 margin: 0 5px 0 0; 124 padding: 0; 125 text-indent: 0; 126 text-align: center; 127 position: relative; 128 -webkit-font-smoothing: antialiased; 129 text-decoration: none !important; 130 } 131 132 #dash-right-now .page-count a:before { 133 content: '\f105'; 134 } 135 136 #dash-right-now .post-count a:before { 137 content: '\f109'; 138 } 139 140 #dash-right-now .comment-count a:before { 141 content: '\f101'; 142 } 143 144 #dash-right-now .comment-mod-count a:before { 145 content: '\f125'; 146 } 147 148 #dash-right-now .storage-count a:before { 149 content: '\f104'; 150 } 151 152 #dash-right-now .storage-count.warning a:before { 153 content: '\f153'; 154 } 155 156 /* Dashboard Quick Draft */ 157 158 #dashboard_quick_draft div.updated { 159 margin-bottom: 10px; 160 border: 1px solid #eee; 161 border-width: 1px 1px 1px 0; 162 } 163 164 #dashboard_quick_draft form { 165 padding: 0 12px 1px 12px; 166 overflow: hidden; 167 } 168 169 #dashboard_quick_draft .drafts, 170 #dashboard_quick_draft .easy-blogging { 171 padding: 8px 12px 0; 172 } 173 174 #dashboard-widgets .postbox .inside { 175 margin: 10px 0; 176 padding: 0; 177 } 178 179 /* Dashboard Quick Draft - Form styling */ 180 181 input#save-post { 182 float: right; 183 } 184 185 form.initial-form label.prompt { 186 font-style: italic; 187 } 188 189 form.initial-form input#title { 190 height: 3em; 191 } 192 193 form.initial-form.quickpress-open label.prompt { 194 font-style: normal; 195 } 196 197 form.initial-form.quickpress-open input#title { 198 height: auto; 199 } 200 201 #dashboard_quick_draft input, 202 #dashboard_quick_draft textarea { 203 box-sizing: border-box; 204 -moz-box-sizing:border-box; 205 -webkit-box-sizing:border-box; 206 margin: 0; 207 } 208 209 #dashboard_quick_draft textarea { 210 resize: vertical; 211 } 212 213 #dashboard-widgets .postbox form .submit { 214 margin: -39px 0; 215 float: right; 216 } 217 218 #description-wrap { 219 margin-top: 12px; 220 } 221 222 #title-wrap #title-prompt-text, 223 .textarea-wrap #content-prompt-text { 224 color: #BBB; 225 } 226 227 #title-wrap #title-prompt-text { 228 font-size: 1.1em; 229 padding: 7px 8px; 230 } 231 232 .initial-form #description-wrap, 233 .initial-form p.submit { 234 display: none; 235 } 236 237 .input-text-wrap, 238 .textarea-wrap { 239 position: relative; 240 } 241 242 .input-text-wrap .prompt, 243 .textarea-wrap .prompt { 244 position: absolute; 245 } 246 247 .textarea-wrap #content-prompt-text { 248 font-size: 1.1em; 249 padding: 7px 8px; 250 } 251 252 .textarea-wrap textarea#content { 253 margin: 0 0 8px; 254 padding: 6px 7px; 255 } 256 257 /* Dashboard Quick Draft - Drafts list */ 258 259 #dashboard_quick_draft .drafts { 260 border-top: 1px solid #eee; 261 margin-top: 12px; 262 } 263 264 #dashboard_quick_draft .drafts abbr { 265 border: none; 266 } 267 268 #dashboard_quick_draft .drafts h4 { 269 margin: 0 0 8px 0; 270 font-weight: normal; 271 } 272 273 #dashboard_quick_draft .drafts .view-all { 274 float: right; 275 margin-top: 0; 276 } 277 278 #draft-list { 279 margin: 0; 280 } 281 282 #draft-list li { 283 margin-bottom: 1em; 284 } 285 #draft-list li time { 286 color: #bbb; 287 } 288 289 #draft-list p { 290 margin: 0; 291 } 292 293 /* Dashboard activity widget */ 294 295 #dashboard_activity h4 { 296 margin: 0 12px 8px; 297 font-weight: normal; 298 } 299 300 #dashboard_activity h4.comment-meta { 301 overflow: hidden; 302 text-overflow: ellipsis; 303 white-space: nowrap; 304 margin-bottom: 4px; 305 } 306 307 #dashboard_activity ul { 308 padding: 0 12px; 309 } 310 311 #dashboard_activity .comment-meta span.approve:before { 312 content: '\f227'; 313 font: 20px/.5 "dashicons"; 314 margin-left: 12px; 315 vertical-align: middle; 316 position: relative; 317 top: -1px; 318 margin-right: 2px; 319 } 320 321 #dashboard_activity .inside { 322 padding: 0; 323 margin: 0; 324 } 325 326 #dashboard_activity .no-activity { 327 overflow: hidden; 328 padding: 0 12px 12px; 329 text-align: center; 330 } 331 332 #dashboard_activity .no-activity p { 333 color: #999; 334 font-size: 16px; 335 } 336 337 #dashboard_activity .no-activity .smiley { 338 margin-top: 0; 339 } 340 341 #dashboard_activity .no-activity .smiley:before { 342 content: '\f328'; 343 font: normal 120px/1 'dashicons'; 344 speak: none; 345 display: block; 346 margin: 0 5px 0 0; 347 padding: 0; 348 text-indent: 0; 349 text-align: center; 350 position: relative; 351 -webkit-font-smoothing: antialiased; 352 text-decoration: none !important; 353 } 354 355 #dashboard_activity .subsubsub { 356 float: none; 357 border-top: 1px solid #eeeeee; 358 margin-top: 0; 359 padding: 8px 12px 0 12px; 360 } 361 362 #future-posts .show-more, 363 #published-posts .show-more { 364 float: right; 365 } 366 367 #future-posts ul, 368 #published-posts ul { 369 clear: both; 370 margin-bottom: 0; 371 } 372 373 #future-posts li, 374 #published-posts li { 375 overflow: hidden; 376 margin-bottom: 8px; 377 } 378 379 #future-posts ul span, 380 #published-posts ul span { 381 color: #bbb; 382 float: left; 383 margin-right: 8px; 384 min-width: 150px; 385 } 386 387 .activity-block { 388 border-bottom: 1px solid #eee; 389 overflow: hidden; 390 padding: 8px 0 0; 391 } 392 393 .activity-block:last-child { 394 border-bottom: none; 395 } 396 397 .activity-block .subsubsub li { 398 color: #ddd; 399 } 400 401 /* Dashboard activity widget - Comments */ 402 403 #the-comment-list tr.undo, #the-comment-list div.undo { 404 background: none; 405 padding: 6px 0; 406 } 407 408 #the-comment-list .alternate, 409 #the-comment-list .alt { 410 background: none; 411 } 412 413 #the-comment-list .comment { 414 background: #f5f5f5; 415 padding: 12px; 416 position: relative; 417 border-top: 1px solid #eeeeee; 418 } 419 420 #the-comment-list img { 421 position: absolute; 422 left: 13px; 423 top: 13px; 424 } 425 426 #the-comment-list .dashboard-comment-wrap { 427 padding-left: 63px; 428 } 429 430 #the-comment-list .dashboard-comment-wrap blockquote { 431 margin: 1em 0; 432 } 433 434 #the-comment-list .comment-item h4 { 435 font-size: 13px; 436 color: #999; 437 } 438 439 #the-comment-list .comment-item p.row-actions { 440 margin: 4px 0 0 0; 441 } 442 443 #the-comment-list .comment-item:first-child { 444 border-top: 1px solid #eeeeee; 445 } 446 447 #the-comment-list .unapproved { 448 background: #f7fcfe; 449 } 450 451 #the-comment-list .unapproved:before { 452 content: ""; 453 display: block; 454 position: absolute; 455 left: 0; 456 top: 0; 457 bottom: 0; 458 background: #d54e21; 459 width: 4px; 460 }