Checking title & taxonomy are set in tag cloud widget before attempting to save them - prevent PHP notice.

This commit is contained in:
Brent Shepherd 2011-12-12 09:41:05 +10:00
parent 10d2431dc6
commit 263fbfe969
1 changed files with 2 additions and 2 deletions

View File

@ -58,8 +58,8 @@ class WooCommerce_Widget_Product_Tag_Cloud extends WP_Widget {
/** @see WP_Widget->update */
function update( $new_instance, $old_instance ) {
$instance['title'] = strip_tags(stripslashes($new_instance['title']));
$instance['taxonomy'] = stripslashes($new_instance['taxonomy']);
$instance['title'] = isset( $new_instance['title'] ) ? strip_tags( stripslashes( $new_instance['title'] ) ) : '';
$instance['taxonomy'] = isset( $new_instance['taxonomy'] ) ? stripslashes( $new_instance['taxonomy'] ) : '';
return $instance;
}