Only one sanitise hook is needed

This commit is contained in:
Mike Jolley 2015-12-14 12:48:03 +00:00
parent afd3aa2fc7
commit 4b45812bac
1 changed files with 2 additions and 7 deletions

View File

@ -175,11 +175,6 @@ abstract class WC_Widget extends WP_Widget {
* Sanitize the value of a 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();
@ -259,8 +254,8 @@ abstract class WC_Widget extends WP_Widget {
break;
// Default: run an action
default:
do_action( 'woocommerce_widget_field_' . $setting['type'], $key, $setting, $class, $value, $instance );
default :
do_action( 'woocommerce_widget_field_' . $setting['type'], $key, $value, $setting, $instance );
break;
}
}