Ticket #27419: 27419.3.patch
File 27419.3.patch, 2.3 KB (added by , 11 years ago) |
---|
-
src/wp-includes/class-wp-customize-widgets.php
429 429 */ 430 430 static function parse_widget_setting_id( $setting_id ) { 431 431 if ( ! preg_match( '/^(widget_(.+?))(?:\[(\d+)\])?$/', $setting_id, $matches ) ) { 432 return new WP_Error( 'invalid_setting_id', 'Invalid widget setting ID');432 return new WP_Error( 'invalid_setting_id', __( 'Invalid widget setting ID.' ) ); 433 433 } 434 434 435 435 $id_base = $matches[2]; … … 923 923 $sanitized_widget_setting = json_decode( self::get_post_value( 'sanitized_widget_setting' ), true ); 924 924 if ( empty( $sanitized_widget_setting ) ) { 925 925 $options_transaction->rollback(); 926 return new WP_Error( 'malformed_ data', 'Malformed sanitized_widget_setting');926 return new WP_Error( 'malformed_widget_setting', __( 'Malformed widget setting.' ) ); 927 927 } 928 928 929 929 $instance = self::sanitize_widget_instance( $sanitized_widget_setting ); 930 930 if ( is_null( $instance ) ) { 931 931 $options_transaction->rollback(); 932 return new WP_Error( 'unsanitary_ data', 'Unsanitary sanitized_widget_setting');932 return new WP_Error( 'unsanitary_widget_setting', __( 'Unsanitary widget setting.' ) ); 933 933 } 934 934 935 935 if ( ! is_null( $parsed_id['number'] ) ) { … … 970 970 if ( 0 !== $options_transaction->count() ) { 971 971 if ( count( $options_transaction->options ) > 1 ) { 972 972 $options_transaction->rollback(); 973 return new WP_Error( ' unexpected_update', 'Widget unexpectedly updated more than one option.');973 return new WP_Error( 'more_than_one_option_updated', __( 'Widget unexpectedly updated more than one option.' ) ); 974 974 } 975 975 976 976 $updated_option_name = key( $options_transaction->options ); 977 977 if ( $updated_option_name !== $option_name ) { 978 978 $options_transaction->rollback(); 979 return new WP_Error( 'wrong_option', sprintf( 'Widget updated option "%1$s", but expected "%2$s".', $updated_option_name, $option_name ) ); 979 // Translators: 1 is updated option name, 2 is expected option name. 980 return new WP_Error( 'wrong_option_updated', sprintf( __( 'Widget updated option "%1$s", but expected "%2$s".' ), $updated_option_name, $option_name ) ); 980 981 } 981 982 } 982 983