diff --git src/wp-includes/post.php src/wp-includes/post.php
index 288704c66d..94006f7b38 100644
|
|
|
function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true ) |
| 4155 | 4155 | */ |
| 4156 | 4156 | $post_type_object = get_post_type_object( $post_type ); |
| 4157 | 4157 | |
| 4158 | | if ( ! $update && 'pending' === $post_status && ! current_user_can( $post_type_object->cap->publish_posts ) ) { |
| | 4158 | if ( ! $update && 'pending' === $post_status && ! empty( $post_type_object ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) { |
| 4159 | 4159 | $post_name = ''; |
| 4160 | 4160 | } elseif ( $update && 'pending' === $post_status && ! current_user_can( 'publish_post', $post_ID ) ) { |
| 4161 | 4161 | $post_name = ''; |