'fantasy', 'description' => __('Displays The Best NBA NFL MLB and WAGS News and Advice from around the web.', 'fantasy') ); /* Widget control settings. */ $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'fantasy-widget' ); /* Create the widget. */ $this->WP_Widget( 'fantasy-widget', __('All Sports Widget', 'fantasy'), $widget_ops, $control_ops ); } /** * How to display the widget on the screen. */ function widget( $args, $instance ) { extract( $args ); /* Our variables from the widget settings. */ $authorcredit = isset($instance['author_credit']) ? $instance['author_credit'] : false ; // give plugin author credit /* Before widget (defined by themes). */ echo $before_widget . $before_title . 'Best Sports Blog' . $after_title; echo ('Get This or Add Your Feed'); /* If show powered was selected, display the user's powered. */ if ( $authorcredit ) printf( '
' . __('Powered By: Fantasy Knuckleheads', 'fantasy.') . '
' ); /* After widget (defined by themes). */ echo $after_widget; } /** * Update the widget settings. */ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['author_credit'] = $new_instance['author_credit']; 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. This handles the confusing stuff. */ function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => __('Fantasy', 'fantasy'), 'authorcredit' => __('false', 'author_credit'), 'authorcredit' => 'false', 'author_credit' => off ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>id="get_field_id( 'author_credit' ); ?>" name="get_field_name( 'author_credit' ); ?>" />