WordPress.org

Make WordPress Core

Changeset 27586


Ignore:
Timestamp:
03/18/2014 04:47:47 PM (7 years ago)
Author:
ocean90
Message:

Widget Customizer: Remove special filter for Settings Revisions plugin.

see #27112.

File:
1 edited

Legend:

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

    r27585 r27586  
    4242        add_filter( 'is_active_sidebar', array( __CLASS__, 'tally_sidebars_via_is_active_sidebar_calls' ), 10, 2 );
    4343        add_filter( 'dynamic_sidebar_has_widgets', array( __CLASS__, 'tally_sidebars_via_dynamic_sidebar_calls' ), 10, 2 );
    44 
    45         /**
    46          * Special filter for Settings Revisions plugin until it can handle
    47          * dynamically creating settings. Normally this should be handled by
    48          * a setting's sanitize_js_callback, but when restoring an old revision
    49          * it may include settings which do not currently exist, and so they
    50          * do not have the opportunity to be sanitized as needed. Furthermore,
    51          * we have to add this filter here because the customizer is not
    52          * initialized in WP Ajax, which is where Settings Revisions currently
    53          * needs to apply this filter at times.
    54          */
    55         add_filter( 'temp_customize_sanitize_js', array( __CLASS__, 'temp_customize_sanitize_js' ), 10, 2 );
    5644    }
    5745
     
    592580
    593581    /**
    594      * Special filter for Settings Revisions plugin until it can handle
    595      * dynamically creating settings.
    596      *
    597      * @param mixed $value
    598      * @param stdClass|WP_Customize_Setting $setting
    599      * @return mixed
    600      */
    601     static function temp_customize_sanitize_js( $value, $setting ) {
    602         if ( preg_match( '/^widget_/', $setting->id ) && $setting->type === 'option' ) {
    603             $value = self::sanitize_widget_js_instance( $value );
    604         }
    605         return $value;
    606     }
    607 
    608     /**
    609582     * Build up an index of all available widgets for use in Backbone models
    610583     *
Note: See TracChangeset for help on using the changeset viewer.