Press This: Use the error message returned by wp_update_post()
instead of a generic one.
props stephdau. fixes #31808. git-svn-id: https://develop.svn.wordpress.org/trunk@31930 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e2a54a80b5
commit
3e9c664a9b
@ -136,8 +136,8 @@ class WP_Press_This {
|
||||
|
||||
$updated = wp_update_post( $post, true );
|
||||
|
||||
if ( is_wp_error( $updated ) || intval( $updated ) < 1 ) {
|
||||
wp_send_json_error( array( 'errorMessage' => __( 'Error while saving the post. Please try again later.' ) ) );
|
||||
if ( is_wp_error( $updated ) ) {
|
||||
wp_send_json_error( array( 'errorMessage' => $updated->get_error_message() ) );
|
||||
} else {
|
||||
if ( isset( $post['post_format'] ) ) {
|
||||
if ( current_theme_supports( 'post-formats', $post['post_format'] ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user