Ticket #16714: 16714.diff
File 16714.diff, 27.0 KB (added by , 14 years ago) |
---|
-
wp-admin/edit.php
Property changes on: . ___________________________________________________________________ Added: svn:ignore + .buildpath .htaccess .settings nbproject wp-config.php
20 20 21 21 $post_type_object = get_post_type_object( $post_type ); 22 22 23 if ( !current_user_can($post_type_object->cap-> edit_posts) )23 if ( !current_user_can($post_type_object->cap->create_posts) ) 24 24 wp_die(__('Cheatin’ uh?')); 25 25 26 26 $wp_list_table = _get_list_table('WP_Posts_List_Table'); … … 190 190 ?> 191 191 <div class="wrap"> 192 192 <?php screen_icon(); ?> 193 <h2><?php echo esc_html( $post_type_object->labels->name ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php 194 if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) 195 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); ?> 193 <h2> 194 <?php 195 echo esc_html( $post_type_object->labels->name ); 196 197 if( current_user_can( $post_type_object->cap->create_posts ) || current_user_can( 'create_pages' ) ) 198 echo '<a href="' . $post_new_file . '" class="button add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>'; 199 200 if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) 201 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); 202 ?> 196 203 </h2> 197 204 198 205 <?php -
wp-admin/includes/dashboard.php
65 65 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' ); 66 66 67 67 // QuickPress Widget 68 if ( is_blog_admin() && current_user_can(' edit_posts') )68 if ( is_blog_admin() && current_user_can('create_posts') ) 69 69 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' ); 70 70 71 71 // Recent Drafts -
wp-admin/includes/post.php
520 520 else 521 521 $ptype = get_post_type_object('post'); 522 522 523 if ( !current_user_can( $ptype->cap-> edit_posts ) ) {523 if ( !current_user_can( $ptype->cap->create_posts ) ) { 524 524 if ( 'page' == $ptype->name ) 525 return new WP_Error( ' edit_pages', __( 'You are not allowed to create pages on this site.' ) );525 return new WP_Error( 'create_pages', __( 'You are not allowed to create pages on this site.' ) ); 526 526 else 527 return new WP_Error( ' edit_posts', __( 'You are not allowed to create posts or drafts on this site.' ) );527 return new WP_Error( 'create_posts', __( 'You are not allowed to create posts or drafts on this site.' ) ); 528 528 } 529 529 530 530 // Check for autosave collisions -
wp-admin/link-add.php
9 9 /** Load WordPress Administration Bootstrap */ 10 10 require_once('./admin.php'); 11 11 12 if ( ! current_user_can(' manage_links') )12 if ( ! current_user_can('create_links') ) 13 13 wp_die(__('You do not have sufficient permissions to add links to this site.')); 14 14 15 15 $title = __('Add New Link'); -
wp-admin/link-manager.php
59 59 60 60 <div class="wrap nosubsub"> 61 61 <?php screen_icon(); ?> 62 <h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a> <?php 63 if ( !empty($_REQUEST['s']) ) 64 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?> 62 <h2> 63 <?php 64 echo esc_html( $title ); 65 66 if( current_user_can( 'create_links' ) ) 67 echo '<a href="link-add.php" class="button add-new-h2">' . esc_html_x( 'Add New', 'link' ) . '</a>'; 68 69 if ( !empty( $_REQUEST['s'] ) ) 70 printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( stripslashes( $_REQUEST['s'] ) ) ); 71 ?> 65 72 </h2> 66 73 67 74 <?php -
wp-admin/menu.php
65 65 $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' ); 66 66 $submenu['edit.php'][5] = array( __('Posts'), 'edit_posts', 'edit.php' ); 67 67 /* translators: add new post */ 68 $submenu['edit.php'][10] = array( _x('Add New', 'post'), ' edit_posts', 'post-new.php' );68 $submenu['edit.php'][10] = array( _x('Add New', 'post'), 'create_posts', 'post-new.php' ); 69 69 70 70 $i = 15; 71 71 foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { … … 84 84 $menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'div' ); 85 85 $submenu['link-manager.php'][5] = array( __('Links'), 'manage_links', 'link-manager.php' ); 86 86 /* translators: add new links */ 87 $submenu['link-manager.php'][10] = array( _x('Add New', 'link'), ' manage_links', 'link-add.php' );87 $submenu['link-manager.php'][10] = array( _x('Add New', 'link'), 'create_links', 'link-add.php' ); 88 88 $submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-tags.php?taxonomy=link_category' ); 89 89 90 90 $menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-page', 'menu-pages', 'div' ); 91 91 $submenu['edit.php?post_type=page'][5] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page' ); 92 92 /* translators: add new page */ 93 $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), ' edit_pages', 'post-new.php?post_type=page' );93 $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'create_pages', 'post-new.php?post_type=page' ); 94 94 $i = 15; 95 95 foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { 96 96 if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) ) … … 127 127 while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) ) 128 128 $ptype_menu_position++; 129 129 130 $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap-> edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon );131 $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->menu_name, $ptype_obj->cap-> edit_posts, "edit.php?post_type=$ptype");132 $submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap-> edit_posts, "post-new.php?post_type=$ptype" );130 $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->create_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon ); 131 $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->menu_name, $ptype_obj->cap->create_posts, "edit.php?post_type=$ptype"); 132 $submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, "post-new.php?post_type=$ptype" ); 133 133 134 134 $i = 15; 135 135 foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { … … 206 206 $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php'); 207 207 } 208 208 209 $menu[75] = array( __('Tools'), ' edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'div' );210 $submenu['tools.php'][5] = array( __('Tools'), ' edit_posts', 'tools.php' );209 $menu[75] = array( __('Tools'), 'create_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'div' ); 210 $submenu['tools.php'][5] = array( __('Tools'), 'create_posts', 'tools.php' ); 211 211 $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' ); 212 212 $submenu['tools.php'][15] = array( __('Export'), 'import', 'export.php' ); 213 213 if ( is_multisite() && !is_main_site() ) -
wp-admin/network/sites.php
99 99 100 100 <div class="wrap"> 101 101 <?php screen_icon('ms-admin'); ?> 102 <h2><?php _e('Sites') ?> 103 <?php echo $msg; ?> 104 <?php if ( current_user_can( 'create_sites') ) : ?> 105 <a href="<?php echo network_admin_url('site-new.php'); ?>" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a> 106 <?php endif; ?> 102 <h2> 103 <?php 104 _e('Sites'); 105 echo $msg; 106 107 if ( current_user_can( 'create_sites') ) 108 echo '<a href="' . network_admin_url('site-new.php') . '" class="button add-new-h2">' . esc_html_x( 'Add New', 'site' ) . '</a>'; 107 109 108 <?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) { 110 if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) 109 111 printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $s ) ); 110 }?>112 ?> 111 113 </h2> 112 114 113 115 <form action="" method="get" id="ms-search"> -
wp-admin/network/themes.php
199 199 200 200 <div class="wrap"> 201 201 <?php screen_icon('themes'); ?> 202 <h2><?php echo esc_html( $title ); if ( current_user_can('install_themes') ) { ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php } 203 if ( $s ) 204 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $s ) ); ?> 202 <h2> 203 <?php 204 echo esc_html( $title ); 205 206 if ( current_user_can('install_themes') ) 207 echo '<a href="theme-install.php" class="button add-new-h2">' . esc_html_x('Add New', 'theme') . '</a>'; 208 209 if ( $s ) 210 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $s ) ); 211 ?> 205 212 </h2> 206 213 207 214 <?php -
wp-admin/network/users.php
72 72 ?> 73 73 <div class="wrap"> 74 74 <?php screen_icon(); ?> 75 <h2><?php esc_html_e( 'Users' ); 76 if ( current_user_can( 'create_users') ) : ?> 77 <a href="<?php echo network_admin_url('user-new.php'); ?>" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php 78 endif; 79 80 if ( !empty( $usersearch ) ) 81 printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $usersearch ) ); 82 ?> 75 <h2> 76 <?php 77 esc_html_e( 'Users' ); 78 79 if ( current_user_can( 'create_users') ) 80 echo '<a href="' . network_admin_url('user-new.php') . '" class="button add-new-h2">' . esc_html_x( 'Add New', 'user' ) . '</a>'; 81 82 if ( !empty( $usersearch ) ) 83 printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $usersearch ) ); 84 ?> 83 85 </h2> 84 86 85 87 <?php $wp_list_table->views(); ?> -
wp-admin/plugins.php
385 385 386 386 <div class="wrap"> 387 387 <?php screen_icon(); ?> 388 <h2><?php echo esc_html( $title ); 389 if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) { ?> 390 <a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="button add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a> 391 <?php } 392 if ( $s ) 393 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $s ) ); ?> 388 <h2> 389 <?php 390 echo esc_html( $title ); 391 if ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_plugins' ) ) 392 echo '<a href="' . self_admin_url( 'plugin-install.php' ) . '" class="button add-new-h2">' . esc_html_x('Add New', 'plugin') . '</a>'; 393 394 if ( $s ) 395 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $s ) ); 396 ?> 394 397 </h2> 395 398 396 399 <?php do_action( 'pre_current_active_plugins', $plugins['all'] ) ?> -
wp-admin/post-new.php
30 30 31 31 $editing = true; 32 32 33 if ( ! current_user_can( $post_type_object->cap-> edit_posts ) )33 if ( ! current_user_can( $post_type_object->cap->create_posts ) ) 34 34 wp_die( __( 'Cheatin’ uh?' ) ); 35 35 36 36 wp_enqueue_script('autosave'); -
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('create_posts') ) 17 17 wp_die( __( 'Cheatin’ uh?' ) ); 18 18 19 19 /** -
wp-admin/tools.php
27 27 <?php screen_icon(); ?> 28 28 <h2><?php echo esc_html( $title ); ?></h2> 29 29 30 <?php if ( current_user_can(' edit_posts') ) : ?>30 <?php if ( current_user_can('create_posts') ) : ?> 31 31 <div class="tool-box"> 32 32 <h3 class="title"><?php _e('Press This') ?></h3> 33 33 <p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p> -
wp-admin/upload.php
160 160 161 161 <div class="wrap"> 162 162 <?php screen_icon(); ?> 163 <h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> <?php 164 if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) 165 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); ?> 163 <h2> 164 <?php 165 echo esc_html( $title ); 166 167 echo '<a href="media-new.php" class="button add-new-h2">' . esc_html_x('Add New', 'file') . '</a>'; 168 169 if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) 170 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); 171 ?> 166 172 </h2> 167 173 168 174 <?php -
wp-admin/users.php
357 357 <div class="wrap"> 358 358 <?php screen_icon(); ?> 359 359 <h2> 360 <?php361 echo esc_html( $title );362 if ( current_user_can( 'create_users' ) ) { ?> 363 <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a> 364 <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?> 365 <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a> 366 <?php}360 <?php 361 echo esc_html( $title ); 362 if ( current_user_can( 'create_users' ) ) { 363 echo '<a href="user-new.php" class="button add-new-h2">' . esc_html_x( 'Add New', 'user' ) . '</a>'; 364 } elseif( is_multisite() && current_user_can( 'promote_users' ) ){ 365 echo '<a href="user-new.php" class="button add-new-h2">' . esc_html_x( 'Add Existing', 'user' ) . '</a>'; 366 } 367 367 368 if ( $usersearch ) 369 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $usersearch ) ); ?> 368 if ( $usersearch ) 369 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $usersearch ) ); 370 ?> 370 371 </h2> 371 372 372 373 <?php $wp_list_table->views(); ?> -
wp-app.php
320 320 function get_service() { 321 321 log_app('function','get_service()'); 322 322 323 if ( !current_user_can( ' edit_posts' ) )323 if ( !current_user_can( 'create_posts' ) ) 324 324 $this->auth_required( __( 'Sorry, you do not have the right to access this site.' ) ); 325 325 326 326 $entries_url = esc_attr($this->get_entries_url()); … … 361 361 function get_categories_xml() { 362 362 log_app('function','get_categories_xml()'); 363 363 364 if ( !current_user_can( ' edit_posts' ) )364 if ( !current_user_can( 'create_posts' ) ) 365 365 $this->auth_required( __( 'Sorry, you do not have the right to access this site.' ) ); 366 366 367 367 $home = esc_attr(get_bloginfo_rss('url')); -
wp-content/themes/twentyten/functions.php
1 1 <?php 2 function test_meta_caps($caps, $cap, $user_id, $args){ 3 echo '<pre>'; 4 print_r( $cap ); 5 echo '</pre>'; 6 return $caps; 7 } 8 //add_filter( 'map_meta_cap', 'test_meta_caps' , 10, 4 ); 2 9 /** 3 10 * TwentyTen functions and definitions 4 11 * -
wp-includes/admin-bar.php
123 123 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname, 'href' => get_admin_url($blog->userblog_id) ) ); 124 124 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url($blog->userblog_id) ) ); 125 125 126 if ( current_user_can_for_blog( $blog->userblog_id, ' edit_posts' ) ) {126 if ( current_user_can_for_blog( $blog->userblog_id, 'create_posts' ) ) { 127 127 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url($blog->userblog_id, 'post-new.php') ) ); 128 128 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url($blog->userblog_id, 'edit-comments.php') ) ); 129 129 } … … 186 186 187 187 $actions = array(); 188 188 foreach ( (array) get_post_types( array( 'show_ui' => true ), 'objects' ) as $ptype_obj ) { 189 if ( true !== $ptype_obj->show_in_menu || ! current_user_can( $ptype_obj->cap-> edit_posts ) )189 if ( true !== $ptype_obj->show_in_menu || ! current_user_can( $ptype_obj->cap->create_posts ) ) 190 190 continue; 191 191 192 $actions[ 'post-new.php?post_type=' . $ptype_obj->name ] = array( $ptype_obj->labels->singular_name, $ptype_obj->cap-> edit_posts, 'new-' . $ptype_obj->name );192 $actions[ 'post-new.php?post_type=' . $ptype_obj->name ] = array( $ptype_obj->labels->singular_name, $ptype_obj->cap->create_posts, 'new-' . $ptype_obj->name ); 193 193 } 194 194 195 195 if ( empty( $actions ) ) … … 210 210 function wp_admin_bar_comments_menu() { 211 211 global $wp_admin_bar; 212 212 213 if ( !current_user_can(' edit_posts') )213 if ( !current_user_can('create_posts') ) 214 214 return; 215 215 216 216 $awaiting_mod = wp_count_comments(); -
wp-includes/capabilities.php
859 859 $caps[] = $post_type->cap->delete_private_posts; 860 860 } 861 861 break; 862 case 'create_posts': 863 $caps[] = 'edit_posts'; 864 break; 865 case 'create_pages'; 866 $caps[] = 'edit_pages'; 867 break; 862 868 // edit_post breaks down to edit_posts, edit_published_posts, or 863 869 // edit_others_posts 864 870 case 'edit_post': … … 997 1003 else 998 1004 $caps[] = 'do_not_allow'; 999 1005 break; 1006 case 'create_links': 1007 $caps[] = 'manage_links'; 1008 break; 1000 1009 default: 1001 1010 // Handle meta capabilities for custom post types. 1002 1011 $post_type_meta_caps = _post_type_meta_capabilities(); -
wp-includes/class-wp-xmlrpc-server.php
774 774 if ( !$user = $this->login($username, $password) ) 775 775 return $this->error; 776 776 777 if ( !current_user_can(" edit_posts") )778 return(new IXR_Error(401, __("Sorry, you cannot editposts on this site.")));777 if ( !current_user_can("create_posts") ) 778 return(new IXR_Error(401, __("Sorry, you cannot create posts on this site."))); 779 779 780 780 do_action('xmlrpc_call', 'wp.getAuthors'); 781 781 … … 809 809 if ( !$user = $this->login($username, $password) ) 810 810 return $this->error; 811 811 812 if ( !current_user_can( ' edit_posts' ) )813 return new IXR_Error( 401, __( 'Sorry, you must be able to editposts on this site in order to view tags.' ) );812 if ( !current_user_can( 'create_posts' ) ) 813 return new IXR_Error( 401, __( 'Sorry, you must be able to create posts on this site in order to view tags.' ) ); 814 814 815 815 do_action( 'xmlrpc_call', 'wp.getKeywords' ); 816 816 … … 938 938 if ( !$user = $this->login($username, $password) ) 939 939 return $this->error; 940 940 941 if ( !current_user_can( ' edit_posts' ) )942 return new IXR_Error( 401, __( 'Sorry, you must be able to editposts to this site in order to view categories.' ) );941 if ( !current_user_can( 'create_posts' ) ) 942 return new IXR_Error( 401, __( 'Sorry, you must be able to create posts to this site in order to view categories.' ) ); 943 943 944 944 do_action('xmlrpc_call', 'wp.suggestCategories'); 945 945 … … 1310 1310 if ( !$user = $this->login($username, $password) ) 1311 1311 return $this->error; 1312 1312 1313 if ( !current_user_can( ' edit_posts' ) )1313 if ( !current_user_can( 'create_posts' ) ) 1314 1314 return new IXR_Error( 403, __( 'You are not allowed access to details about comments.' ) ); 1315 1315 1316 1316 do_action('xmlrpc_call', 'wp.getCommentCount'); … … 1342 1342 if ( !$user = $this->login($username, $password) ) 1343 1343 return $this->error; 1344 1344 1345 if ( !current_user_can( ' edit_posts' ) )1345 if ( !current_user_can( 'create_posts' ) ) 1346 1346 return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); 1347 1347 1348 1348 do_action('xmlrpc_call', 'wp.getPostStatusList'); … … 1368 1368 if ( !$user = $this->login($username, $password) ) 1369 1369 return $this->error; 1370 1370 1371 if ( !current_user_can( ' edit_pages' ) )1371 if ( !current_user_can( 'create_pages' ) ) 1372 1372 return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); 1373 1373 1374 1374 do_action('xmlrpc_call', 'wp.getPageStatusList'); … … 1724 1724 if ( !$user = $this->login($username, $password) ) 1725 1725 return $this->error; 1726 1726 1727 if ( !current_user_can( ' edit_posts' ) )1727 if ( !current_user_can( 'create_posts' ) ) 1728 1728 return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this site.' ) ); 1729 1729 1730 1730 do_action('xmlrpc_call', 'blogger.getUserInfo'); … … 1945 1945 1946 1946 do_action('xmlrpc_call', 'blogger.newPost'); 1947 1947 1948 $cap = ($publish) ? 'publish_posts' : ' edit_posts';1948 $cap = ($publish) ? 'publish_posts' : 'create_posts'; 1949 1949 if ( !current_user_can($cap) ) 1950 1950 return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.')); 1951 1951 … … 2112 2112 elseif ('publish' == $content_struct['post_status']) 2113 2113 $cap = 'publish_posts'; 2114 2114 else 2115 $cap = ' edit_posts';2115 $cap = 'create_posts'; 2116 2116 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 2117 2117 $post_type = 'post'; 2118 2118 } else { … … 2125 2125 elseif ('publish' == $content_struct['post_status']) 2126 2126 $cap = 'publish_posts'; 2127 2127 else 2128 $cap = ' edit_posts';2128 $cap = 'create_posts'; 2129 2129 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 2130 2130 $post_type = 'post'; 2131 2131 } … … 2405 2405 2406 2406 do_action('xmlrpc_call', 'metaWeblog.editPost'); 2407 2407 2408 $cap = ( $publish ) ? 'publish_posts' : ' edit_posts';2408 $cap = ( $publish ) ? 'publish_posts' : 'create_posts'; 2409 2409 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 2410 2410 $post_type = 'post'; 2411 2411 $page_template = ''; … … 2423 2423 if ( $publish || 'publish' == $content_struct['post_status'] ) 2424 2424 $cap = 'publish_posts'; 2425 2425 else 2426 $cap = ' edit_posts';2426 $cap = 'create_posts'; 2427 2427 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 2428 2428 $post_type = 'post'; 2429 2429 } else { … … 2434 2434 if ( $publish || 'publish' == $content_struct['post_status'] ) 2435 2435 $cap = 'publish_posts'; 2436 2436 else 2437 $cap = ' edit_posts';2437 $cap = 'create_posts'; 2438 2438 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 2439 2439 $post_type = 'post'; 2440 2440 } … … 2909 2909 if ( !$user = $this->login($username, $password) ) 2910 2910 return $this->error; 2911 2911 2912 if ( !current_user_can( ' edit_posts' ) )2913 return new IXR_Error( 401, __( 'Sorry, you must be able to editposts on this site in order to view categories.' ) );2912 if ( !current_user_can( 'create_posts' ) ) 2913 return new IXR_Error( 401, __( 'Sorry, you must be able to create posts on this site in order to view categories.' ) ); 2914 2914 2915 2915 do_action('xmlrpc_call', 'metaWeblog.getCategories'); 2916 2916 … … 3100 3100 if ( !$user = $this->login($username, $password) ) 3101 3101 return $this->error; 3102 3102 3103 if ( !current_user_can( ' edit_posts' ) )3104 return new IXR_Error( 401, __( 'Sorry, you must be able to editposts on this site in order to view categories.' ) );3103 if ( !current_user_can( 'create_posts' ) ) 3104 return new IXR_Error( 401, __( 'Sorry, you must be able to create posts on this site in order to view categories.' ) ); 3105 3105 3106 3106 do_action('xmlrpc_call', 'mt.getCategoryList'); 3107 3107 -
wp-includes/post.php
1086 1086 'read_post' => 'read_' . $singular_base, 1087 1087 'delete_post' => 'delete_' . $singular_base, 1088 1088 // Primitive capabilities used outside of map_meta_cap(): 1089 'edit_posts' => 'edit_' . $plural_base, 1089 'create_posts' => 'create_' . $plural_base, 1090 'edit_posts' => 'edit_' . $plural_base, 1090 1091 'edit_others_posts' => 'edit_others_' . $plural_base, 1091 1092 'publish_posts' => 'publish_' . $plural_base, 1092 1093 'read_private_posts' => 'read_private_' . $plural_base,