Ticket #16714: 16714.6.diff
File 16714.6.diff, 4.8 KB (added by , 12 years ago) |
---|
-
wp-includes/post.php
1411 1411 'edit_others_posts' => 'edit_others_' . $plural_base, 1412 1412 'publish_posts' => 'publish_' . $plural_base, 1413 1413 'read_private_posts' => 'read_private_' . $plural_base, 1414 // Post creation capability simply maps to edit_posts by default:1415 'create_posts' => 'edit_' . $plural_base,1416 1414 ); 1417 1415 1418 1416 // Primitive capabilities used within map_meta_cap(): … … 1431 1429 1432 1430 $capabilities = array_merge( $default_capabilities, $args->capabilities ); 1433 1431 1432 // Post creation capability simply maps to edit_posts by default: 1433 if ( ! isset( $capabilities['create_posts'] ) ) 1434 $capabilities['create_posts'] = $capabilities['edit_posts']; 1435 1434 1436 // Remember meta capabilities for future reference. 1435 1437 if ( $args->map_meta_cap ) 1436 1438 _post_type_meta_capabilities( $capabilities ); -
wp-admin/post-new.php
36 36 37 37 $editing = true; 38 38 39 if ( ! current_user_can( $post_type_object->cap->edit_posts ) )39 if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) 40 40 wp_die( __( 'Cheatin’ uh?' ) ); 41 41 42 42 // Schedule auto-draft cleanup -
wp-admin/index.php
76 76 $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>'; 77 77 if ( current_user_can( 'publish_posts' ) ) 78 78 $help .= '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>'; 79 if ( current_user_can( ' edit_posts' ) ) {79 if ( current_user_can( 'create_posts' ) ) { 80 80 $help .= '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>'; 81 81 $help .= '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you’ve started.') . '</p>'; 82 82 } -
wp-admin/edit-form-advanced.php
274 274 275 275 <div class="wrap"> 276 276 <?php screen_icon(); ?> 277 <h2><?php echo esc_html( $title ); ?><?php if ( isset( $post_new_file ) ) : ?> <a href="<?php echo esc_url( $post_new_file ) ?>" class="add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a><?php endif; ?></h2> 277 <h2><?php 278 echo esc_html( $title ); 279 if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) 280 echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>'; 281 ?></h2> 278 282 <?php if ( $notice ) : ?> 279 283 <div id="notice" class="error"><p><?php echo $notice ?></p></div> 280 284 <?php endif; ?> -
wp-admin/edit.php
221 221 ?> 222 222 <div class="wrap"> 223 223 <?php screen_icon(); ?> 224 <h2><?php echo esc_html( $post_type_object->labels->name ); ?> <a href="<?php echo $post_new_file ?>" class="add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php 224 <h2><?php 225 echo esc_html( $post_type_object->labels->name ); 226 if ( current_user_can( $post_type_object->cap->create_posts ) ) 227 echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>'; 225 228 if ( ! empty( $_REQUEST['s'] ) ) 226 printf( ' <span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); ?>227 </h2>229 printf( ' <span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); 230 ?></h2> 228 231 229 232 <?php if ( isset( $_REQUEST['locked'] ) || isset( $_REQUEST['updated'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) ) { 230 233 $messages = array(); -
wp-admin/press-this.php
13 13 14 14 header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 15 15 16 if ( ! current_user_can( 'edit_posts') )16 if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( 'create_posts' ) ) 17 17 wp_die( __( 'Cheatin’ uh?' ) ); 18 18 19 19 /**