Make WordPress Core


Ignore:
Timestamp:
03/29/2014 09:43:39 PM (12 years ago)
Author:
ocean90
Message:

Widget Customizer: Remove strings from WP_Error returns and go with just IDs.

fixes #27419.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r27823 r27854  
    509509        public function parse_widget_setting_id( $setting_id ) {
    510510                if ( ! preg_match( '/^(widget_(.+?))(?:\[(\d+)\])?$/', $setting_id, $matches ) ) {
    511                         return new WP_Error( 'invalid_setting_id', 'Invalid widget setting ID' );
     511                        return new WP_Error( 'widget_setting_invalid_id' );
    512512                }
    513513
     
    10581058                        if ( empty( $sanitized_widget_setting ) ) {
    10591059                                $this->stop_capturing_option_updates();
    1060                                 return new WP_Error( 'malformed_data', 'Malformed sanitized_widget_setting' );
     1060                                return new WP_Error( 'widget_setting_malformed' );
    10611061                        }
    10621062
     
    10641064                        if ( is_null( $instance ) ) {
    10651065                                $this->stop_capturing_option_updates();
    1066                                 return new WP_Error( 'unsanitary_data', 'Unsanitary sanitized_widget_setting' );
     1066                                return new WP_Error( 'widget_setting_unsanitized' );
    10671067                        }
    10681068
     
    11011101                        if ( $this->count_captured_options() > 1 ) {
    11021102                                $this->stop_capturing_option_updates();
    1103                                 return new WP_Error( 'unexpected_update', 'Widget unexpectedly updated more than one option.' );
     1103                                return new WP_Error( 'widget_setting_too_many_options' );
    11041104                        }
    11051105
     
    11071107                        if ( $updated_option_name !== $option_name ) {
    11081108                                $this->stop_capturing_option_updates();
    1109                                 return new WP_Error( 'wrong_option', sprintf( 'Widget updated option "%1$s", but expected "%2$s".', $updated_option_name, $option_name ) );
     1109                                return new WP_Error( 'widget_setting_unexpected_option' );
    11101110                        }
    11111111                }
Note: See TracChangeset for help on using the changeset viewer.