GC_Customize_Setting::_preview_filter()
最后更新于:2021-11-27 08:47:18
GC_Customize_Setting::_preview_filter( mixed$original)Callback function to filter non-multidimensional theme mods and options.
参数
- $original
-
(mixed) (Required) Old value.
响应
(mixed) New or old value.
源文件
文件: gc-includes/class-gc-customize-setting.php
public function _preview_filter( $original ) {
if ( ! $this->is_current_blog_previewed() ) {
return $original;
}
$undefined = new stdClass(); // Symbol hack.
$post_value = $this->post_value( $undefined );
if ( $undefined !== $post_value ) {
$value = $post_value;
} else {
/*
* Note that we don't use $original here because preview() will
* not add the filter in the first place if it has an initial value
* and there is no post value.
*/
$value = $this->default;
}
return $value;
}