WordPress.org

Make WordPress Core

Changeset 27001


Ignore:
Timestamp:
01/22/2014 05:17:34 PM (6 years ago)
Author:
nacin
Message:

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

Merges [26999] to the 3.8 branch.

props mattheu.
fixes #26574.

Location:
branches/3.8
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

  • branches/3.8/src/wp-admin/css/wp-admin.css

    r26965 r27001  
    29662966/* Dashboard right now - Colors */
    29672967
    2968 #dashboard_right_now li a:before {
     2968#dashboard_right_now li a:before,
     2969#dashboard_right_now li span:before {
    29692970    color: #888;
    29702971}
     
    29852986}
    29862987
    2987 #dashboard_right_now .warning a:before {
     2988#dashboard_right_now .warning a:before,
     2989#dashboard_right_now .warning span:before {
    29882990    color: #d54e21;
    29892991}
    29902992
    29912993/* Dashboard right now - Icons */
    2992 #dashboard_right_now li a:before {
     2994#dashboard_right_now li a:before,
     2995#dashboard_right_now li span:before {
    29932996    content: '\f159';
    29942997    font: normal 20px/1 'dashicons';
     
    30053008}
    30063009
    3007 #dashboard_right_now .page-count a:before {
     3010#dashboard_right_now .page-count a:before,
     3011#dashboard_right_now .page-count span:before {
    30083012    content: '\f105';
    30093013}
    30103014
    3011 #dashboard_right_now .post-count a:before {
     3015#dashboard_right_now .post-count a:before,
     3016#dashboard_right_now .post-count span:before {
    30123017    content: '\f109';
    30133018}
  • branches/3.8/src/wp-admin/includes/dashboard.php

    r26832 r27001  
    195195            }
    196196            $text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
    197             printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text );
     197            $post_type_object = get_post_type_object( $post_type );
     198            if ( $post_type_object && current_user_can( $post_type_object->cap->edit_posts ) ) {
     199                printf( '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s</a></li>', $post_type, $text );
     200            } else {
     201                printf( '<li class="%1$s-count"><span>%2$s</span></li>', $post_type, $text );
     202            }
     203
    198204        }
    199205    }
Note: See TracChangeset for help on using the changeset viewer.