Only one sanitise hook is needed
This commit is contained in:
parent
afd3aa2fc7
commit
4b45812bac
|
@ -175,11 +175,6 @@ abstract class WC_Widget extends WP_Widget {
|
||||||
* Sanitize the value of a setting.
|
* Sanitize the value of a setting.
|
||||||
*/
|
*/
|
||||||
$instance[ $key ] = apply_filters( 'woocommerce_widget_settings_sanitize_option', $instance[ $key ], $new_instance, $key, $setting );
|
$instance[ $key ] = apply_filters( 'woocommerce_widget_settings_sanitize_option', $instance[ $key ], $new_instance, $key, $setting );
|
||||||
|
|
||||||
/**
|
|
||||||
* Sanitize the value of a setting by its key.
|
|
||||||
*/
|
|
||||||
$instance[ $key ] = apply_filters( "woocommerce_widget_settings_sanitize_option_$key", $instance[ $key ], $new_instance, $key, $setting );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->flush_widget_cache();
|
$this->flush_widget_cache();
|
||||||
|
@ -259,8 +254,8 @@ abstract class WC_Widget extends WP_Widget {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Default: run an action
|
// Default: run an action
|
||||||
default:
|
default :
|
||||||
do_action( 'woocommerce_widget_field_' . $setting['type'], $key, $setting, $class, $value, $instance );
|
do_action( 'woocommerce_widget_field_' . $setting['type'], $key, $value, $setting, $instance );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue