GC_Customize_Widgets::capture_filter_pre_update_option()
最后更新于:2021-11-27 09:45:19
GC_Customize_Widgets::capture_filter_pre_update_option( mixed$new_value, string$option_name, mixed$old_value)Pre-filters captured option values before updating.
参数
- $new_value
-
(mixed) (Required) The new option value.
- $option_name
-
(string) (Required) Name of the option.
- $old_value
-
(mixed) (Required) The old option value.
响应
(mixed) Filtered option value.
源文件
文件: gc-includes/class-gc-customize-widgets.php
public function capture_filter_pre_update_option( $new_value, $option_name, $old_value ) {
if ( $this->is_option_capture_ignored( $option_name ) ) {
return $new_value;
}
if ( ! isset( $this->_captured_options[ $option_name ] ) ) {
add_filter( "pre_option_{$option_name}", array( $this, 'capture_filter_pre_get_option' ) );
}
$this->_captured_options[ $option_name ] = $new_value;
return $old_value;
}