WordPress.org

Make WordPress Core

Ticket #30448: 30448-customizer-patch-2.diff

File 30448-customizer-patch-2.diff, 615 bytes (added by CrazyJaco, 5 years ago)

Add parameter to setting->save() method

  • wp-includes/class-wp-customize-setting.php

    diff --git wp-includes/class-wp-customize-setting.php wp-includes/class-wp-customize-setting.php
    index 0207b70..3592c62 100644
    class WP_Customize_Setting { 
    170170         *
    171171         * @return false|null False if cap check fails or value isn't set.
    172172         */
    173         public final function save() {
    174                 $value = $this->post_value();
     173        public final function save( $value = null ) {
     174                if ( ! isset( $value ) ) {
     175                        $value = $this->post_value();
     176                }
    175177
    176178                if ( ! $this->check_capabilities() || ! isset( $value ) )
    177179                        return false;