diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index ee8af5b3ad..9301bed4e1 100644
a
|
b
|
class WP_REST_Posts_Controller extends WP_REST_Controller { |
1147 | 1147 | break; |
1148 | 1148 | case 'publish': |
1149 | 1149 | case 'future': |
1150 | | if ( ! current_user_can( $post_type->cap->publish_posts ) ) { |
| 1150 | if ( ! current_user_can( $post_type->cap->publish_posts ) && ! current_user_can( $post_type->cap->edit_published_posts ) ) { |
1151 | 1151 | return new WP_Error( 'rest_cannot_publish', __( 'Sorry, you are not allowed to publish posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); |
1152 | 1152 | } |
1153 | 1153 | break; |
… |
… |
class WP_REST_Posts_Controller extends WP_REST_Controller { |
1817 | 1817 | |
1818 | 1818 | $post_type = get_post_type_object( $post->post_type ); |
1819 | 1819 | |
1820 | | if ( 'attachment' !== $this->post_type && current_user_can( $post_type->cap->publish_posts ) ) { |
| 1820 | if ( 'attachment' !== $this->post_type && ( ( 'publish' == $post->post_status && current_user_can( $post_type->cap->edit_published_posts ) ) || current_user_can( $post_type->cap->publish_posts ) ) ) { |
1821 | 1821 | $rels[] = 'https://api.w.org/action-publish'; |
1822 | 1822 | } |
1823 | 1823 | |