'SMS_Platform_Keyword_Checker_Widget', 'description' => 'Checks an inputted keyword for usage in the SMS Platform.' ); /* Widget control settings. */ $control_ops = array('width' => 300, 'height' => 350); parent::WP_Widget('sms_platform_keyword_checker_widget', 'SMS Platform Keyword Checker', $widget_ops, $control_ops); } /** * Displays the widget on the screen. * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ public function widget($args, $instance) { extract($args); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', $instance['title'] ); /*$name = $instance['name']; $sex = $instance['sex']; $show_sex = isset( $instance['show_sex'] ) ? $instance['show_sex'] : false;*/ /* Before widget (defined by themes). */ echo $before_widget; //ENTER OUTPUT /* After widget (defined by themes). */ echo $after_widget; } /** * The newly calculated value of $instance should be returned. * If "false" is returned, the instance won't be saved/updated. * @param array $new_instance New settings for this instance as input by the user via form() * @param array $old_instance Old settings for this instance * @return array Settings to save or bool false to cancel saving */ function update($new_instance, $old_instance) { $instance = $old_instance; if ( ($new_instance['country'] != 'US') || ($new_instance['country'] != 'CA') ) { return false; } if ( (empty($new_instance['username'])) || (empty($new_instance['password'])) || (empty($new_instance['customerNumber'])) ) { return false; } $instance['title'] = strip_tags($new_instance['title']); $instance['country'] = strip_tags($new_instance['country']); $instance['username'] = strip_tags($new_instance['username']); $instance['password'] = strip_tags($new_instance['password']); $instance['customerNumber'] = strip_tags($new_instance['customerNumber']); return $instance; } /** * Displays the widget settings controls on the widget panel. * Make use of the get_field_id() and get_field_name() function * when creating your form elements. */ function form($instance) { ?>