Make WordPress Core

Ticket #27419: 27419.3.patch

File 27419.3.patch, 2.3 KB (added by ocean90, 11 years ago)

()

  • src/wp-includes/class-wp-customize-widgets.php

     
    429429         */
    430430        static function parse_widget_setting_id( $setting_id ) {
    431431                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.' ) );
    433433                }
    434434
    435435                $id_base = $matches[2];
     
    923923                        $sanitized_widget_setting = json_decode( self::get_post_value( 'sanitized_widget_setting' ), true );
    924924                        if ( empty( $sanitized_widget_setting ) ) {
    925925                                $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.' ) );
    927927                        }
    928928
    929929                        $instance = self::sanitize_widget_instance( $sanitized_widget_setting );
    930930                        if ( is_null( $instance ) ) {
    931931                                $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.' ) );
    933933                        }
    934934
    935935                        if ( ! is_null( $parsed_id['number'] ) ) {
     
    970970                if ( 0 !== $options_transaction->count() ) {
    971971                        if ( count( $options_transaction->options ) > 1 ) {
    972972                                $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.' ) );
    974974                        }
    975975
    976976                        $updated_option_name = key( $options_transaction->options );
    977977                        if ( $updated_option_name !== $option_name ) {
    978978                                $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 ) );
    980981                        }
    981982                }
    982983