woocommerce_widget_settings_sanitize_option
Sanitize the value of a setting.
Использование
add_filter( 'woocommerce_widget_settings_sanitize_option', 'wp_kama_woocommerce_widget_settings_sanitize_option_filter', 10, 4 ); /** * Function for `woocommerce_widget_settings_sanitize_option` filter-hook. * * @param $key ] * @param $new_instance * @param $key * @param $setting * * @return */ function wp_kama_woocommerce_widget_settings_sanitize_option_filter( $key ], $new_instance, $key, $setting ){ // filter... return $key ]; }
- $key ]
- -
- $new_instance
- -
- $key
- -
- $setting
- -
Где вызывается хук
woocommerce_widget_settings_sanitize_option
woocommerce/includes/abstracts/abstract-wc-widget.php 230
$instance[ $key ] = apply_filters( 'woocommerce_widget_settings_sanitize_option', $instance[ $key ], $new_instance, $key, $setting );