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

props mattheu.
see #26574 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@26999 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
nacin 2014-01-22 16:51:07 +00:00
parent 46bdc2c312
commit ce00f36ab7
2 changed files with 17 additions and 6 deletions

View File

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

View File

@ -194,7 +194,13 @@ function wp_dashboard_right_now() {
$text = _n( '%s Page', '%s Pages', $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