defaults = array( 'post_type' => 'post', 'category_name' => '', 'tag' => '', 'posts_per_page' => '5', 'orderby' => 'date', 'order' => 'DESC', 'image_size' => 'medium', 'image_link' => 0, 'show_caption' => 'none', 'show_content' => 'none' ); $widget_ops = array( 'classname' => 'flexslider_widget', 'description' => __( 'Responsive slider able to showcase any post type', 'acfs' ), ); $control_ops = array( 'id_base' => 'arconix-flexslider-widget' ); $this->WP_Widget( 'arconix-flexslider-widget', 'Arconix - FlexSlider', $widget_ops, $control_ops ); } /** * Widget Output * * @param type $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param type $instance The settings for the particular instance of the widget * @since 0.1 * @version 0.5 */ function widget( $args, $instance ) { extract( $args, EXTR_SKIP ); /* Merge with defaults */ $instance = wp_parse_args( ( array )$instance, $this->defaults ); /* Before widget (defined by themes) */ echo $before_widget; /* Title of widget (before and after defined by themes) */ if( ! empty( $instance['title'] ) ) echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; /* Run our query and output our results */ flexslider_query( $instance ); /* After widget (defined by themes) */ echo $after_widget; } /** * Update a particular instance. * * @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 * @since 0.1 * @version 0.5 */ function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = strip_tags( $new_instance['title'] ); $instance['posts_per_page'] = absint( $new_instance['posts_per_page'] ); $instance['category_name'] = strip_tags( $new_instance['category_name'] ); $instance['tag'] = strip_tags( $new_instance['tag'] ); return $new_instance; } /** * Widget form * * @param array $instance Current settings * @since 0.1 * @version 0.5 */ function form( $instance ) { /* Merge with defaults */ $instance = wp_parse_args( (array) $instance, $this->defaults ); ?>

/>