Merge branch 'pr/9790'

This commit is contained in:
Mike Jolley 2015-12-14 12:48:11 +00:00
commit f992f98b39
1 changed files with 10 additions and 0 deletions

View File

@ -170,6 +170,11 @@ abstract class WC_Widget extends WP_Widget {
$instance[ $key ] = sanitize_text_field( $new_instance[ $key ] );
break;
}
/**
* Sanitize the value of a setting.
*/
$instance[ $key ] = apply_filters( 'woocommerce_widget_settings_sanitize_option', $instance[ $key ], $new_instance, $key, $setting );
}
$this->flush_widget_cache();
@ -247,6 +252,11 @@ abstract class WC_Widget extends WP_Widget {
</p>
<?php
break;
// Default: run an action
default :
do_action( 'woocommerce_widget_field_' . $setting['type'], $key, $value, $setting, $instance );
break;
}
}
}