Changeset 39320 for trunk/src/wp-includes/class-wp-customize-manager.php
- Timestamp:
- 11/19/2016 10:38:40 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r39276 r39320 1729 1729 continue; 1730 1730 } 1731 if ( is_null( $unsanitized_value ) ) {1732 continue;1733 }1734 1731 if ( $options['validate_capability'] && ! current_user_can( $setting->capability ) ) { 1735 1732 $validity = new WP_Error( 'unauthorized', __( 'Unauthorized to modify setting due to capability.' ) ); 1736 1733 } else { 1734 if ( is_null( $unsanitized_value ) ) { 1735 continue; 1736 } 1737 1737 $validity = $setting->validate( $unsanitized_value ); 1738 1738 } … … 2031 2031 } 2032 2032 } 2033 $post_values = wp_array_slice_assoc( $post_values, $changed_setting_ids );2034 2033 2035 2034 /** … … 2047 2046 2048 2047 // Validate settings. 2049 $setting_validities = $this->validate_setting_values( $post_values, array( 2048 $validated_values = array_merge( 2049 array_fill_keys( array_keys( $args['data'] ), null ), // Make sure existence/capability checks are done on value-less setting updates. 2050 $post_values 2051 ); 2052 $setting_validities = $this->validate_setting_values( $validated_values, array( 2050 2053 'validate_capability' => true, 2051 2054 'validate_existence' => true, … … 2065 2068 } 2066 2069 2067 $response = array(2068 'setting_validities' => $setting_validities,2069 );2070 2071 2070 // Obtain/merge data for changeset. 2072 2071 $original_changeset_data = $this->get_changeset_post_data( $changeset_post_id ); … … 2106 2105 unset( $data[ $changeset_setting_id ] ); 2107 2106 } else { 2108 // Merge any additional setting params that have been supplied with the existing params. 2107 2109 2108 if ( ! isset( $data[ $changeset_setting_id ] ) ) { 2110 2109 $data[ $changeset_setting_id ] = array(); 2111 2110 } 2112 2111 2112 // Merge any additional setting params that have been supplied with the existing params. 2113 $merged_setting_params = array_merge( $data[ $changeset_setting_id ], $setting_params ); 2114 2115 // Skip updating setting params if unchanged (ensuring the user_id is not overwritten). 2116 if ( $data[ $changeset_setting_id ] === $merged_setting_params ) { 2117 continue; 2118 } 2119 2113 2120 $data[ $changeset_setting_id ] = array_merge( 2114 $data[ $changeset_setting_id ], 2115 $setting_params, 2121 $merged_setting_params, 2116 2122 array( 2117 2123 'type' => $setting->type, … … 2220 2226 2221 2227 remove_filter( 'wp_save_post_revision_post_has_changed', array( $this, '_filter_revision_post_has_changed' ) ); 2228 2229 $response = array( 2230 'setting_validities' => $setting_validities, 2231 ); 2222 2232 2223 2233 if ( is_wp_error( $r ) ) {
Note: See TracChangeset
for help on using the changeset viewer.