WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/02/2016 10:41:36 PM (3 years ago)
Author:
westonruter
Message:

Customize: Pass WP_Customize_Setting instance as second argument to customize_value_{$id_base} filter.

Adds parity with setting instance being passed as second argument to customize_sanitize_{$id} and customize_sanitize_js_{$id}. Allows the actual ID of the (multidimensional) setting value being filtered to be inspected.

Props celloexpressions, westonruter.
Fixes #36452.

File:
1 edited

Legend:

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

    r37342 r37350  
    658658             *
    659659             * @since 3.4.0
     660             * @since 4.6.0 Added the `$this` setting instance as the second param.
    660661             *
    661              * @param mixed $default The setting default value. Default empty.
     662             * @param mixed                $default The setting default value. Default empty.
     663             * @param WP_Customize_Setting $this    The setting instance.
    662664             */
    663             $value = apply_filters( "customize_value_{$id_base}", $value );
    664         } else if ( $this->is_multidimensional_aggregated ) {
     665            $value = apply_filters( "customize_value_{$id_base}", $value, $this );
     666        } elseif ( $this->is_multidimensional_aggregated ) {
    665667            $root_value = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'];
    666668            $value = $this->multidimensional_get( $root_value, $this->id_data['keys'], $this->default );
Note: See TracChangeset for help on using the changeset viewer.