Make WordPress Core

Changeset 46814


Ignore:
Timestamp:
12/05/2019 01:46:43 PM (7 years ago)
Author:
SergeyBiryukov
Message:

XML-RPC: Unify some "could not be created/updated/deleted" error messages for consistency.

Props ramiy, SergeyBiryukov.
Fixes #48883.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r46750 r46814  
    16381638
    16391639                if ( ! $post_ID ) {
    1640                         return new IXR_Error( 401, __( 'Sorry, your entry could not be posted.' ) );
     1640                        if ( $update ) {
     1641                                return new IXR_Error( 401, __( 'Sorry, the post could not be updated.' ) );
     1642                        } else {
     1643                                return new IXR_Error( 401, __( 'Sorry, the post could not be created.' ) );
     1644                        }
    16411645                }
    16421646
    … …  
    17781782
    17791783                if ( ! $result ) {
    1780                         return new IXR_Error( 500, __( 'The post cannot be deleted.' ) );
     1784                        return new IXR_Error( 500, __( 'Sorry, the post could not be deleted.' ) );
    17811785                }
    17821786
    … …  
    20802084
    20812085                if ( ! $term ) {
    2082                         return new IXR_Error( 500, __( 'Sorry, your term could not be created.' ) );
     2086                        return new IXR_Error( 500, __( 'Sorry, the term could not be created.' ) );
    20832087                }
    20842088
    … …  
    28782882
    28792883                if ( ! $result ) {
    2880                         return new IXR_Error( 500, __( 'Sorry, the user cannot be updated.' ) );
     2884                        return new IXR_Error( 500, __( 'Sorry, the user could not be updated.' ) );
    28812885                }
    28822886
    … …  
    33773381                                return (int) $cat_id->get_error_data();
    33783382                        } else {
    3379                                 return new IXR_Error( 500, __( 'Sorry, the new category failed.' ) );
     3383                                return new IXR_Error( 500, __( 'Sorry, the category could not be created.' ) );
    33803384                        }
    33813385                } elseif ( ! $cat_id ) {
    3382                         return new IXR_Error( 500, __( 'Sorry, the new category failed.' ) );
     3386                        return new IXR_Error( 500, __( 'Sorry, the category could not be created.' ) );
    33833387                }
    33843388
    … …  
    37893793
    37903794                if ( ! $result ) {
    3791                         return new IXR_Error( 500, __( 'Sorry, the comment could not be edited.' ) );
     3795                        return new IXR_Error( 500, __( 'Sorry, the comment could not be updated.' ) );
    37923796                }
    37933797
    … …  
    49804984         */
    49814985        public function blogger_getTemplate( $args ) {
    4982                 return new IXR_Error( 403, __( 'Sorry, that file cannot be edited.' ) );
     4986                return new IXR_Error( 403, __( 'Sorry, this method is not supported.' ) );
    49834987        }
    49844988
    … …  
    49934997         */
    49944998        public function blogger_setTemplate( $args ) {
    4995                 return new IXR_Error( 403, __( 'Sorry, that file cannot be edited.' ) );
     4999                return new IXR_Error( 403, __( 'Sorry, this method is not supported.' ) );
    49965000        }
    49975001
    … …  
    50535057
    50545058                if ( ! $post_ID ) {
    5055                         return new IXR_Error( 500, __( 'Sorry, your entry could not be posted.' ) );
     5059                        return new IXR_Error( 500, __( 'Sorry, the post could not be created.' ) );
    50565060                }
    50575061
    … …  
    51335137
    51345138                if ( ! $result ) {
    5135                         return new IXR_Error( 500, __( 'For some strange yet very annoying reason, this post could not be edited.' ) );
     5139                        return new IXR_Error( 500, __( 'Sorry, the post could not be updated.' ) );
    51365140                }
    51375141                $this->attach_uploads( $actual_post['ID'], $postdata['post_content'] );
    … …  
    51935197
    51945198                if ( ! $result ) {
    5195                         return new IXR_Error( 500, __( 'The post cannot be deleted.' ) );
     5199                        return new IXR_Error( 500, __( 'Sorry, the post could not be deleted.' ) );
    51965200                }
    51975201
    … …  
    55455549
    55465550                if ( ! $post_ID ) {
    5547                         return new IXR_Error( 500, __( 'Sorry, your entry could not be posted.' ) );
     5551                        return new IXR_Error( 500, __( 'Sorry, the post could not be created.' ) );
    55485552                }
    55495553
    … …  
    58905894
    58915895                if ( ! $result ) {
    5892                         return new IXR_Error( 500, __( 'Sorry, your entry could not be edited.' ) );
     5896                        return new IXR_Error( 500, __( 'Sorry, the post could not be updated.' ) );
    58935897                }
    58945898
Note: See TracChangeset for help on using the changeset viewer.