'event-posts', 'description' => __( 'A list of events.', 'themify-event-post' ) ); /* Widget control settings. */ $control_ops = array('id_base' => 'themify-event-post'); /* Create the widget. */ parent::__construct('themify-event-post', __( 'Themify - Event Posts', 'themify-event-post' ), $widget_ops, $control_ops); } /** * Initialize widget * * @param array $args * @param array $instance */ function widget( $args, $instance ) { echo Themify_Event_Post::get_instance()->get_template( 'widget-posts', array( 'args' => $args, 'instance' => $instance, 'widget' => $this, ) ); } /** * Save widget options * * @param array $new_instance * @param array $old_instance * * @return array */ function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags (if needed) and update the widget settings. */ $instance['title'] = strip_tags( $new_instance['title'] ); $instance['category'] = $new_instance['category']; $instance['show_count'] = $new_instance['show_count']; $instance['show'] = $new_instance['show']; return $instance; } /** * Render widget form * @param array $instance * * @return string|void */ function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => __( 'Events', 'themify-event-post' ), 'category' => 0, 'show_count' => 5, 'show' => 'upcoming', ); $instance = wp_parse_args( (array) $instance, $defaults ); $categories = get_categories( array( 'taxonomy' => 'event-category' ) ); ?>
'event-categories', 'description' => __( 'A list of event categories.', 'themify-event-post' ) ); /* Widget control settings. */ $control_ops = array( 'id_base' => 'themify-event-categories' ); /* Create the widget. */ parent::__construct( 'themify-event-categories', __( 'Themify - Event Categories', 'themify-event-post' ), $widget_ops, $control_ops ); } /** * Initialize widget * * @param array $args * @param array $instance */ function widget( $args, $instance ) { echo Themify_Event_Post::get_instance()->get_template( 'widget-categories', array( 'args' => $args, 'instance' => $instance, 'widget' => $this, ) ); } /** * Save widget options * * @param array $new_instance * @param array $old_instance * * @return array */ function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags (if needed) and update the widget settings. */ $instance['title'] = strip_tags( $new_instance['title'] ); $instance['parent'] = $new_instance['parent']; $instance['depth'] = $new_instance['depth']; $instance['orderby'] = $new_instance['orderby']; $instance['exclude'] = $new_instance['exclude']; $instance['show_dropdown'] = $new_instance['show_dropdown']; $instance['show_counts'] = $new_instance['show_counts']; $instance['show_hierarchy'] = $new_instance['show_hierarchy']; return $instance; } /** * Render widget form * @param array $instance * * @return string|void */ function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => __('Categories', 'themify-event-post'), 'parent' => 0, 'depth' => 0, 'orderby' => 'name', 'exclude' => '', 'show_dropdown' => false, 'show_counts' => false, 'show_hierarchy' => true ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>
'event-category', 'show_option_all' => __('All', 'themify-event-post'), 'orderby' => 'name', 'hierarchical' => 1, 'selected' => $instance['parent'], 'id' => $this->get_field_id( 'parent' ), 'name' => $this->get_field_name( 'parent' ), )); ?>
id="get_field_id( 'show_dropdown' ); ?>" name="get_field_name( 'show_dropdown' ) ); ?>" />
id="get_field_id( 'show_counts' ); ?>" name="get_field_name( 'show_counts' ) ); ?>" />
id="get_field_id( 'show_hierarchy' ); ?>" name="get_field_name( 'show_hierarchy' ) ); ?>" />