WordPress.org

Make WordPress Core

Ticket #16714: 16714.diff

File 16714.diff, 27.0 KB (added by casben79, 7 years ago)

Initial Attempt

  • wp-admin/edit.php

    Property changes on: .
    ___________________________________________________________________
    Added: svn:ignore
       + .buildpath
    .htaccess
    .settings
    nbproject
    wp-config.php
    
    
     
    2020
    2121$post_type_object = get_post_type_object( $post_type );
    2222
    23 if ( !current_user_can($post_type_object->cap->edit_posts) )
     23if ( !current_user_can($post_type_object->cap->create_posts) )
    2424        wp_die(__('Cheatin’ uh?'));
    2525
    2626$wp_list_table = _get_list_table('WP_Posts_List_Table');
     
    190190?>
    191191<div class="wrap">
    192192<?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 &#8220;%s&#8221;') . '</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 &#8220;%s&#8221;') . '</span>', get_search_query() );
     202    ?>
    196203</h2>
    197204
    198205<?php
  • wp-admin/includes/dashboard.php

     
    6565                wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
    6666
    6767        // QuickPress Widget
    68         if ( is_blog_admin() && current_user_can('edit_posts') )
     68        if ( is_blog_admin() && current_user_can('create_posts') )
    6969                wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
    7070
    7171        // Recent Drafts
  • wp-admin/includes/post.php

     
    520520        else
    521521                $ptype = get_post_type_object('post');
    522522
    523         if ( !current_user_can( $ptype->cap->edit_posts ) ) {
     523        if ( !current_user_can( $ptype->cap->create_posts ) ) {
    524524                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.' ) );
    526526                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.' ) );
    528528        }
    529529
    530530        // Check for autosave collisions
  • wp-admin/link-add.php

     
    99/** Load WordPress Administration Bootstrap */
    1010require_once('./admin.php');
    1111
    12 if ( ! current_user_can('manage_links') )
     12if ( ! current_user_can('create_links') )
    1313        wp_die(__('You do not have sufficient permissions to add links to this site.'));
    1414
    1515$title = __('Add New Link');
  • wp-admin/link-manager.php

     
    5959
    6060<div class="wrap nosubsub">
    6161<?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 &#8220;%s&#8221;') . '</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 &#8220;%s&#8221;' ) . '</span>', esc_html( stripslashes( $_REQUEST['s'] ) ) );
     71    ?>
    6572</h2>
    6673
    6774<?php
  • wp-admin/menu.php

     
    6565$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' );
    6666        $submenu['edit.php'][5]  = array( __('Posts'), 'edit_posts', 'edit.php' );
    6767        /* 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' );
    6969
    7070        $i = 15;
    7171        foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
     
    8484$menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'div' );
    8585        $submenu['link-manager.php'][5] = array( __('Links'), 'manage_links', 'link-manager.php' );
    8686        /* 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' );
    8888        $submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-tags.php?taxonomy=link_category' );
    8989
    9090$menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-page', 'menu-pages', 'div' );
    9191        $submenu['edit.php?post_type=page'][5] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page' );
    9292        /* 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' );
    9494        $i = 15;
    9595        foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
    9696                if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) )
     
    127127        while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) )
    128128                $ptype_menu_position++;
    129129
    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" );
    133133
    134134        $i = 15;
    135135        foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
     
    206206                $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php');
    207207}
    208208
    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' );
    211211        $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' );
    212212        $submenu['tools.php'][15] = array( __('Export'), 'import', 'export.php' );
    213213        if ( is_multisite() && !is_main_site() )
  • wp-admin/network/sites.php

     
    9999
    100100<div class="wrap">
    101101<?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>';
    107109
    108 <?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
     110    if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] )
    109111        printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
    110 } ?>
     112    ?>
    111113</h2>
    112114
    113115<form action="" method="get" id="ms-search">
  • wp-admin/network/themes.php

     
    199199
    200200<div class="wrap">
    201201<?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 &#8220;%s&#8221;') . '</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 &#8220;%s&#8221;') . '</span>', esc_html( $s ) );
     211    ?>
    205212</h2>
    206213
    207214<?php
  • wp-admin/network/users.php

     
    7272        ?>
    7373<div class="wrap">
    7474        <?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 &#8220;%s&#8221;' ) . '</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 &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
     84            ?>
    8385        </h2>
    8486
    8587        <?php $wp_list_table->views(); ?>
  • wp-admin/plugins.php

     
    385385
    386386<div class="wrap">
    387387<?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 &#8220;%s&#8221;') . '</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 &#8220;%s&#8221;') . '</span>', esc_html( $s ) );
     396    ?>
    394397</h2>
    395398
    396399<?php do_action( 'pre_current_active_plugins', $plugins['all'] ) ?>
  • wp-admin/post-new.php

     
    3030
    3131$editing = true;
    3232
    33 if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
     33if ( ! current_user_can( $post_type_object->cap->create_posts ) )
    3434        wp_die( __( 'Cheatin&#8217; uh?' ) );
    3535
    3636wp_enqueue_script('autosave');
  • wp-admin/press-this.php

     
    1313
    1414header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    1515
    16 if ( ! current_user_can('edit_posts') )
     16if ( ! current_user_can('create_posts') )
    1717        wp_die( __( 'Cheatin&#8217; uh?' ) );
    1818
    1919/**
  • wp-admin/tools.php

     
    2727<?php screen_icon(); ?>
    2828<h2><?php echo esc_html( $title ); ?></h2>
    2929
    30 <?php if ( current_user_can('edit_posts') ) : ?>
     30<?php if ( current_user_can('create_posts') ) : ?>
    3131<div class="tool-box">
    3232        <h3 class="title"><?php _e('Press This') ?></h3>
    3333        <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

     
    160160
    161161<div class="wrap">
    162162<?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 &#8220;%s&#8221;') . '</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 &#8220;%s&#8221;') . '</span>', get_search_query() );
     171    ?>
    166172</h2>
    167173
    168174<?php
  • wp-admin/users.php

     
    357357<div class="wrap">
    358358<?php screen_icon(); ?>
    359359<h2>
    360 <?php
    361 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    }
    367367
    368 if ( $usersearch )
    369         printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $usersearch ) ); ?>
     368    if ( $usersearch )
     369            printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $usersearch ) );
     370    ?>
    370371</h2>
    371372
    372373<?php $wp_list_table->views(); ?>
  • wp-app.php

     
    320320        function get_service() {
    321321                log_app('function','get_service()');
    322322
    323                 if ( !current_user_can( 'edit_posts' ) )
     323                if ( !current_user_can( 'create_posts' ) )
    324324                        $this->auth_required( __( 'Sorry, you do not have the right to access this site.' ) );
    325325
    326326                $entries_url = esc_attr($this->get_entries_url());
     
    361361        function get_categories_xml() {
    362362                log_app('function','get_categories_xml()');
    363363
    364                 if ( !current_user_can( 'edit_posts' ) )
     364                if ( !current_user_can( 'create_posts' ) )
    365365                        $this->auth_required( __( 'Sorry, you do not have the right to access this site.' ) );
    366366
    367367                $home = esc_attr(get_bloginfo_rss('url'));
  • wp-content/themes/twentyten/functions.php

     
    11<?php
     2function 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 );
    29/**
    310 * TwentyTen functions and definitions
    411 *
  • wp-includes/admin-bar.php

     
    123123                $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname,  'href' => get_admin_url($blog->userblog_id) ) );
    124124                $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) ) );
    125125
    126                 if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) {
     126                if ( current_user_can_for_blog( $blog->userblog_id, 'create_posts' ) ) {
    127127                        $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') ) );
    128128                        $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') ) );
    129129                }
     
    186186
    187187        $actions = array();
    188188        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 ) )
    190190                        continue;
    191191
    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 );
    193193        }
    194194
    195195        if ( empty( $actions ) )
     
    210210function wp_admin_bar_comments_menu() {
    211211        global $wp_admin_bar;
    212212
    213         if ( !current_user_can('edit_posts') )
     213        if ( !current_user_can('create_posts') )
    214214                return;
    215215
    216216        $awaiting_mod = wp_count_comments();
  • wp-includes/capabilities.php

     
    859859                                $caps[] = $post_type->cap->delete_private_posts;
    860860                }
    861861                break;
     862        case 'create_posts':
     863            $caps[] = 'edit_posts';
     864            break;
     865        case 'create_pages';
     866            $caps[] = 'edit_pages';
     867            break;
    862868                // edit_post breaks down to edit_posts, edit_published_posts, or
    863869                // edit_others_posts
    864870        case 'edit_post':
     
    9971003                else
    9981004                        $caps[] = 'do_not_allow';
    9991005                break;
     1006        case 'create_links':
     1007            $caps[] = 'manage_links';
     1008            break;
    10001009        default:
    10011010                // Handle meta capabilities for custom post types.
    10021011                $post_type_meta_caps = _post_type_meta_capabilities();
  • wp-includes/class-wp-xmlrpc-server.php

     
    774774                if ( !$user = $this->login($username, $password) )
    775775                        return $this->error;
    776776
    777                 if ( !current_user_can("edit_posts") )
    778                         return(new IXR_Error(401, __("Sorry, you cannot edit posts on this site.")));
     777                if ( !current_user_can("create_posts") )
     778                        return(new IXR_Error(401, __("Sorry, you cannot create posts on this site.")));
    779779
    780780                do_action('xmlrpc_call', 'wp.getAuthors');
    781781
     
    809809                if ( !$user = $this->login($username, $password) )
    810810                        return $this->error;
    811811
    812                 if ( !current_user_can( 'edit_posts' ) )
    813                         return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts 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.' ) );
    814814
    815815                do_action( 'xmlrpc_call', 'wp.getKeywords' );
    816816
     
    938938                if ( !$user = $this->login($username, $password) )
    939939                        return $this->error;
    940940
    941                 if ( !current_user_can( 'edit_posts' ) )
    942                         return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts 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.' ) );
    943943
    944944                do_action('xmlrpc_call', 'wp.suggestCategories');
    945945
     
    13101310                if ( !$user = $this->login($username, $password) )
    13111311                        return $this->error;
    13121312
    1313                 if ( !current_user_can( 'edit_posts' ) )
     1313                if ( !current_user_can( 'create_posts' ) )
    13141314                        return new IXR_Error( 403, __( 'You are not allowed access to details about comments.' ) );
    13151315
    13161316                do_action('xmlrpc_call', 'wp.getCommentCount');
     
    13421342                if ( !$user = $this->login($username, $password) )
    13431343                        return $this->error;
    13441344
    1345                 if ( !current_user_can( 'edit_posts' ) )
     1345                if ( !current_user_can( 'create_posts' ) )
    13461346                        return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
    13471347
    13481348                do_action('xmlrpc_call', 'wp.getPostStatusList');
     
    13681368                if ( !$user = $this->login($username, $password) )
    13691369                        return $this->error;
    13701370
    1371                 if ( !current_user_can( 'edit_pages' ) )
     1371                if ( !current_user_can( 'create_pages' ) )
    13721372                        return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
    13731373
    13741374                do_action('xmlrpc_call', 'wp.getPageStatusList');
     
    17241724                if ( !$user = $this->login($username, $password) )
    17251725                        return $this->error;
    17261726
    1727                 if ( !current_user_can( 'edit_posts' ) )
     1727                if ( !current_user_can( 'create_posts' ) )
    17281728                        return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this site.' ) );
    17291729
    17301730                do_action('xmlrpc_call', 'blogger.getUserInfo');
     
    19451945
    19461946                do_action('xmlrpc_call', 'blogger.newPost');
    19471947
    1948                 $cap = ($publish) ? 'publish_posts' : 'edit_posts';
     1948                $cap = ($publish) ? 'publish_posts' : 'create_posts';
    19491949                if ( !current_user_can($cap) )
    19501950                        return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.'));
    19511951
     
    21122112                                elseif ('publish' == $content_struct['post_status'])
    21132113                                        $cap  = 'publish_posts';
    21142114                                else
    2115                                         $cap = 'edit_posts';
     2115                                        $cap = 'create_posts';
    21162116                                $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
    21172117                                $post_type = 'post';
    21182118                        } else {
     
    21252125                        elseif ('publish' == $content_struct['post_status'])
    21262126                                $cap  = 'publish_posts';
    21272127                        else
    2128                                 $cap = 'edit_posts';
     2128                                $cap = 'create_posts';
    21292129                        $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
    21302130                        $post_type = 'post';
    21312131                }
     
    24052405
    24062406                do_action('xmlrpc_call', 'metaWeblog.editPost');
    24072407
    2408                 $cap = ( $publish ) ? 'publish_posts' : 'edit_posts';
     2408                $cap = ( $publish ) ? 'publish_posts' : 'create_posts';
    24092409                $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
    24102410                $post_type = 'post';
    24112411                $page_template = '';
     
    24232423                                if ( $publish || 'publish' == $content_struct['post_status'] )
    24242424                                        $cap  = 'publish_posts';
    24252425                                else
    2426                                         $cap = 'edit_posts';
     2426                                        $cap = 'create_posts';
    24272427                                $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
    24282428                                $post_type = 'post';
    24292429                        } else {
     
    24342434                        if ( $publish || 'publish' == $content_struct['post_status'] )
    24352435                                $cap  = 'publish_posts';
    24362436                        else
    2437                                 $cap = 'edit_posts';
     2437                                $cap = 'create_posts';
    24382438                        $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
    24392439                        $post_type = 'post';
    24402440                }
     
    29092909                if ( !$user = $this->login($username, $password) )
    29102910                        return $this->error;
    29112911
    2912                 if ( !current_user_can( 'edit_posts' ) )
    2913                         return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts 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.' ) );
    29142914
    29152915                do_action('xmlrpc_call', 'metaWeblog.getCategories');
    29162916
     
    31003100                if ( !$user = $this->login($username, $password) )
    31013101                        return $this->error;
    31023102
    3103                 if ( !current_user_can( 'edit_posts' ) )
    3104                         return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts 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.' ) );
    31053105
    31063106                do_action('xmlrpc_call', 'mt.getCategoryList');
    31073107
  • wp-includes/post.php

     
    10861086                'read_post'          => 'read_'         . $singular_base,
    10871087                'delete_post'        => 'delete_'       . $singular_base,
    10881088                // 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,
    10901091                'edit_others_posts'  => 'edit_others_'  . $plural_base,
    10911092                'publish_posts'      => 'publish_'      . $plural_base,
    10921093                'read_private_posts' => 'read_private_' . $plural_base,