__( 'sidebar', 'simplecatch' ), 'id' => 'sidebar', 'description' => __( 'sidebar', 'simplecatch' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '


' ) ); } add_action( 'widgets_init', 'simplecatch_widgets_init' ); /** * Extends class wp_widget * * Creates a function CustomTagWidget * $widget_ops option array passed to wp_register_sidebar_widget(). * $control_ops option array passed to wp_register_widget_control(). * $name, Name for this widget which appear on widget bar. */ class CustomTagWidget extends WP_Widget { /** * Constructor * * @return void **/ function CustomTagWidget() { $widget_ops = array( 'classname' => 'simplecatch_tag_widget', 'description' => __( 'Displays Custom Tag Cloud designed for Simple Catch Theme.', 'simplecatch' ) ); $this->WP_Widget( 'simplecatch_tag_widget', __( '1. Simple Catch: Tag Clouds', 'simplecatch' ), $widget_ops ); $this->alt_option_name = 'simplecatch_tag_widget'; } /** * Displays the Widget in the front-end. * * $args Display arguments including before_title, after_title, before_widget, and after_widget. * $instance The settings for the particular instance of the widget */ function widget( $args, $instance ) { extract( $args ); extract( $instance ); $title = !empty( $instance['title'] ) ? $instance[ 'title' ] : 'Tags'; echo $before_widget; if ( $title ): echo $before_title . $title . $after_title; endif; if ( function_exists( 'simplecatch_custom_tag_cloud' ) ): simplecatch_custom_tag_cloud(); endif; echo $after_widget; } /** * update the particular instant * * This function should check that $new_instance is set correctly. * The newly calculated value of $instance should be returned. * If "false" is returned, the instance won't be saved/updated. * * $new_instance New settings for this instance as input by the user via form() * $old_instance Old settings for this instance * Settings to save or bool false to cancel saving */ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); return $instance; } /** * Creates the form for the widget in the back-end which includes the Title , adcode, image, alt * $instance Current settings */ function form($instance) { $instance = wp_parse_args( ( array ) $instance, array( 'title'=>'Tags' ) ); $title = esc_attr( $instance[ 'title' ] ); /** * Constructs title attributes for use in form() field * @return string Name attribute for $field_name */ echo '

'; } }// end CustomTagWidget class /** * Extends class wp_widget * * Creates a function simplecatch_social_widget * $widget_ops option array passed to wp_register_sidebar_widget(). * $control_ops option array passed to wp_register_widget_control(). * $name, Name for this widget which appear on widget bar. */ class simplecatch_social_widget extends WP_Widget { /** * Constructor * * @return void **/ function simplecatch_social_widget() { $widget_ops = array( 'classname' => 'simplecatch_social_widget', 'description' => __( 'Displays Social Icons added from Theme Options Panel.', 'simplecatch' ) ); $this->WP_Widget( 'simplecatch_social_widget', __( '2. Simple Catch: Social Icons', 'simplecatch' ), $widget_ops ); $this->alt_option_name = 'simplecatch_social_widget'; } /** * Displays the Widget in the front-end. * * $args Display arguments including before_title, after_title, before_widget, and after_widget. * $instance The settings for the particular instance of the widget */ function widget( $args, $instance ) { extract( $args ); extract( $instance ); $title = !empty( $instance['title'] ) ? $instance[ 'title' ] : ''; echo $before_widget; if ( $title != '' ) { echo $before_title . apply_filters( 'widget_title', $title, $instance, $this->id_base ) . $after_title; } if ( function_exists( 'simplecatch_headersocialnetworks' ) ): simplecatch_headersocialnetworks(); endif; echo $after_widget; } /** * update the particular instant * * This function should check that $new_instance is set correctly. * The newly calculated value of $instance should be returned. * If "false" is returned, the instance won't be saved/updated. * * $new_instance New settings for this instance as input by the user via form() * $old_instance Old settings for this instance * Settings to save or bool false to cancel saving */ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); return $instance; } /** * Creates the form for the widget in the back-end which includes the Title , adcode, image, alt * $instance Current settings */ function form($instance) { $instance = wp_parse_args( ( array ) $instance, array( 'title'=>'' ) ); $title = esc_attr( $instance[ 'title' ] ); /** * Constructs title attributes for use in form() field * @return string Name attribute for $field_name */ echo '

'; } }// end simplecatch_social_widget class /** * Makes a custom Widget for Displaying Ads * * Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets * * @package Catch Themes * @subpackage Simple_Catch * @since Simple Catch 2.6.4 */ class simplecatch_adspace_widget extends WP_Widget { /** * Constructor * * @return void **/ function simplecatch_adspace_widget() { $widget_ops = array( 'classname' => 'widget_simplecatch_adspace_widget', 'description' => __( 'Use this widget to add any type of Advertisement as a widget.', 'simplecatch' ) ); $this->WP_Widget( 'widget_simplecatch_adspace_widget', __( '3. Simple Catch: Advertisement', 'simplecatch' ), $widget_ops ); $this->alt_option_name = 'widget_simplecatch_adspace_widget'; } /** * Creates the form for the widget in the back-end which includes the Title , adcode, image, alt * $instance Current settings */ function form($instance) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'adcode' => '', 'image' => '', 'href' => '', 'target' => '0', 'alt' => '' ) ); $title = esc_attr( $instance[ 'title' ] ); $adcode = esc_textarea( $instance[ 'adcode' ] ); $image = esc_url( $instance[ 'image' ] ); $href = esc_url( $instance[ 'href' ] ); $target = $instance['target'] ? 'checked="checked"' : ''; $alt = esc_attr( $instance[ 'alt' ] ); ?>

or

id="get_field_id('target'); ?>" name="get_field_name('target'); ?>" />

id_base ) . $after_title; } if ( $adcode != '' ) { echo $adcode; } elseif ( $image != '' ) { echo ''.$alt.''; } else { _e( 'Add Advertisement Code or Image URL', 'simplecatch' ); } echo $after_widget; } }