Ticket #16714: 16714.11.diff
File 16714.11.diff, 4.9 KB (added by , 12 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
1016 1016 if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) ) 1017 1017 return new IXR_Error( 401, __( 'The post type may not be changed.' ) ); 1018 1018 } else { 1019 if ( ! current_user_can( $post_type->cap-> edit_posts ) )1019 if ( ! current_user_can( $post_type->cap->create_posts ) || ! current_user_can( $post_type->cap->edit_posts ) ) 1020 1020 return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) ); 1021 1021 } 1022 1022 … … 3928 3928 do_action('xmlrpc_call', 'blogger.newPost'); 3929 3929 3930 3930 $cap = ($publish) ? 'publish_posts' : 'edit_posts'; 3931 if ( ! current_user_can($cap) )3931 if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || !current_user_can($cap) ) 3932 3932 return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.')); 3933 3933 3934 3934 $post_status = ($publish) ? 'publish' : 'draft'; … … 4143 4143 $post_type = 'post'; 4144 4144 } 4145 4145 4146 if ( ! current_user_can( get_post_type_object( $post_type )->cap->create_posts ) ) 4147 return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts on this site.' ) ); 4146 4148 if ( !current_user_can( $cap ) ) 4147 4149 return new IXR_Error( 401, $error_message ); 4148 4150 -
wp-includes/capabilities.php
1060 1060 $caps[] = $post_type->cap->delete_private_posts; 1061 1061 } 1062 1062 break; 1063 // current_user_can( 'create_posts', $post_type )1064 case 'create_posts':1065 $post_type = isset( $args[0] ) ? $args[0] : 'post';1066 $post_type_object = get_post_type_object( $post_type );1067 1068 $caps[] = $post_type_object->cap->create_posts;1069 1070 break;1071 1063 // edit_post breaks down to edit_posts, edit_published_posts, or 1072 1064 // edit_others_posts 1073 1065 case 'edit_post': -
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( 'create_posts') ) {79 if ( current_user_can( get_post_type_object( 'post' )->cap->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/menu.php
49 49 $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'none' ); 50 50 $submenu['edit.php'][5] = array( __('All Posts'), 'edit_posts', 'edit.php' ); 51 51 /* translators: add new post */ 52 $submenu['edit.php'][10] = array( _x('Add New', 'post'), 'create_posts', 'post-new.php' );52 $submenu['edit.php'][10] = array( _x('Add New', 'post'), get_post_type_object( 'post' )->cap->create_posts, 'post-new.php' ); 53 53 54 54 $i = 15; 55 55 foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { … … 81 81 $menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-page', 'menu-pages', 'none' ); 82 82 $submenu['edit.php?post_type=page'][5] = array( __('All Pages'), 'edit_pages', 'edit.php?post_type=page' ); 83 83 /* translators: add new page */ 84 $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' );84 $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), get_post_type_object( 'page' )->cap->create_posts, 'post-new.php?post_type=page' ); 85 85 $i = 15; 86 86 foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { 87 87 if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) ) -
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' ) || ! current_user_can( 'create_posts') )16 if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object('post')->cap->create_posts ) ) 17 17 wp_die( __( 'Cheatin’ uh?' ) ); 18 18 19 19 /**