Make WordPress Core


Ignore:
Timestamp:
03/30/2015 02:38:35 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Press This: Use the error message returned by wp_update_post() instead of a generic one.

props stephdau.
fixes #31808.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-press-this.php

    r31925 r31930  
    137137        $updated = wp_update_post( $post, true );
    138138
    139         if ( is_wp_error( $updated ) || intval( $updated ) < 1 ) {
    140             wp_send_json_error( array( 'errorMessage' => __( 'Error while saving the post. Please try again later.' ) ) );
     139        if ( is_wp_error( $updated ) ) {
     140            wp_send_json_error( array( 'errorMessage' => $updated->get_error_message() ) );
    141141        } else {
    142142            if ( isset( $post['post_format'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.