Dashboard widgets: Don't link to Pages or Posts for Authors or Contributors respectively.

props mattheu.
see #26574 for trunk.

Built from https://develop.svn.wordpress.org/trunk@26999


git-svn-id: http://core.svn.wordpress.org/trunk@26876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-01-22 16:52:11 +00:00
parent 74ace0517c
commit 06efe8130d
5 changed files with 29 additions and 13 deletions

View File

@ -2965,7 +2965,8 @@ body #dashboard-widgets .postbox form .submit {
/* Dashboard right now - Colors */ /* Dashboard right now - Colors */
#dashboard_right_now li a:before { #dashboard_right_now li a:before,
#dashboard_right_now li span:before {
color: #888; color: #888;
} }
@ -2984,12 +2985,14 @@ body #dashboard-widgets .postbox form .submit {
margin: 0 0 1em; margin: 0 0 1em;
} }
#dashboard_right_now .warning a:before { #dashboard_right_now .warning a:before,
#dashboard_right_now .warning span:before {
color: #d54e21; color: #d54e21;
} }
/* Dashboard right now - Icons */ /* Dashboard right now - Icons */
#dashboard_right_now li a:before { #dashboard_right_now li a:before,
#dashboard_right_now li span:before {
content: '\f159'; content: '\f159';
font: normal 20px/1 'dashicons'; font: normal 20px/1 'dashicons';
speak: none; speak: none;
@ -3004,11 +3007,13 @@ body #dashboard-widgets .postbox form .submit {
text-decoration: none !important; text-decoration: none !important;
} }
#dashboard_right_now .page-count a:before { #dashboard_right_now .page-count a:before,
#dashboard_right_now .page-count span:before {
content: '\f105'; content: '\f105';
} }
#dashboard_right_now .post-count a:before { #dashboard_right_now .post-count a:before,
#dashboard_right_now .post-count span:before {
content: '\f109'; content: '\f109';
} }

File diff suppressed because one or more lines are too long

View File

@ -2965,7 +2965,8 @@ body #dashboard-widgets .postbox form .submit {
/* Dashboard right now - Colors */ /* Dashboard right now - Colors */
#dashboard_right_now li a:before { #dashboard_right_now li a:before,
#dashboard_right_now li span:before {
color: #888; color: #888;
} }
@ -2984,12 +2985,14 @@ body #dashboard-widgets .postbox form .submit {
margin: 0 0 1em; margin: 0 0 1em;
} }
#dashboard_right_now .warning a:before { #dashboard_right_now .warning a:before,
#dashboard_right_now .warning span:before {
color: #d54e21; color: #d54e21;
} }
/* Dashboard right now - Icons */ /* Dashboard right now - Icons */
#dashboard_right_now li a:before { #dashboard_right_now li a:before,
#dashboard_right_now li span:before {
content: '\f159'; content: '\f159';
font: normal 20px/1 'dashicons'; font: normal 20px/1 'dashicons';
speak: none; speak: none;
@ -3004,11 +3007,13 @@ body #dashboard-widgets .postbox form .submit {
text-decoration: none !important; text-decoration: none !important;
} }
#dashboard_right_now .page-count a:before { #dashboard_right_now .page-count a:before,
#dashboard_right_now .page-count span:before {
content: '\f105'; content: '\f105';
} }
#dashboard_right_now .post-count a:before { #dashboard_right_now .post-count a:before,
#dashboard_right_now .post-count span:before {
content: '\f109'; content: '\f109';
} }

File diff suppressed because one or more lines are too long

View File

@ -194,7 +194,13 @@ function wp_dashboard_right_now() {
$text = _n( '%s Page', '%s Pages', $num_posts->publish ); $text = _n( '%s Page', '%s Pages', $num_posts->publish );
} }
$text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); $text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text ); $post_type_object = get_post_type_object( $post_type );
if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text );
} else {
printf( '<li class="%1$s-count"><span>%2$s</span></li>', $post_type, $text );
}
} }
} }
// Comments // Comments