WordPress.org

Make WordPress Core

Ticket #19933: 19933.diff

File 19933.diff, 2.7 KB (added by nacin, 2 years ago)

current_user_can()

  • wp-admin/index.php

     
    5858) ); 
    5959 
    6060$help  = '<p>' . __('The boxes on your Dashboard screen are:') . '</p>'; 
    61 $help .= '<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p>'; 
    62 $help .= '<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p>'; 
    63 $help .= '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>'; 
    64 $help .= '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>'; 
    65 $help .= '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you&#8217;ve started.') . '</p>'; 
     61if ( current_user_can( 'edit_posts' ) ) 
     62        $help .= '<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p>'; 
     63if ( current_user_can( 'moderate_comments' ) ) 
     64        $help .= '<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p>'; 
     65if ( current_user_can( 'publish_posts' ) ) 
     66        $help .= '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>'; 
     67if ( current_user_can( 'edit_posts' ) ) { 
     68        $help .= '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>'; 
     69        $help .= '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you&#8217;ve started.') . '</p>'; 
     70} 
    6671$help .= '<p>' . __('<strong>WordPress Blog</strong> - Latest news from the official WordPress project.') . '</p>'; 
    6772$help .= '<p>' . __('<strong>Other WordPress News</strong> - Shows the <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a> feed. You can configure it to show a different feed of your choosing.') . '</p>'; 
    68 $help .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>'; 
     73if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) 
     74        $help .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>'; 
    6975 
    7076get_current_screen()->add_help_tab( array( 
    7177        'id'      => 'help-content',