Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-admin/edit-form-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
}

if ( $post_type_object->public
&& ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) )
&& ! ( 'pending' === get_post_status( $post ) && ! current_user_can( 'publish_post', $post ) )
) {
$has_sample_permalink = $sample_permalink_html && 'auto-draft' !== $post->post_status;
?>
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function post_submit_meta_box( $post, $args = array() ) {
$post_id = (int) $post->ID;
$post_type = $post->post_type;
$post_type_object = get_post_type_object( $post_type );
$can_publish = current_user_can( $post_type_object->cap->publish_posts );
$can_publish = current_user_can( 'publish_post', $post );
?>
<div class="submitbox" id="submitpost">

Expand Down Expand Up @@ -1559,7 +1559,7 @@ function register_and_do_post_meta_boxes( $post ) {
}
}

if ( ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
if ( ! ( 'pending' === get_post_status( $post ) && ! current_user_can( 'publish_post', $post ) ) ) {
add_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function edit_post( $post_data = null ) {

wp_set_post_lock( $post_ID );

if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( 'publish_post', $post_ID ) ) {
if ( ! empty( $post_data['sticky'] ) ) {
stick_post( $post_ID );
} else {
Expand Down
Loading