'fusion-tabs-widget', 'description' => 'Popular posts, recent post and comments.', ); $control_ops = array( 'id_base' => 'pyre_tabs-widget', ); parent::__construct( 'pyre_tabs-widget', 'Avada: Tabs', $widget_ops, $control_ops ); } /** * Echoes the widget content. * * @access public * @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 ) { global $post; extract( $args ); $design_tabs = isset( $instance['design_tabs'] ) ? $instance['design_tabs'] : 'classic'; $design_posts = isset( $instance['design_posts'] ) ? $instance['design_posts'] : 'image_default'; $posts = isset( $instance['posts'] ) ? $instance['posts'] : 3; $comments = isset( $instance['comments'] ) ? $instance['comments'] : '3'; $tags_count = isset( $instance['tags'] ) ? $instance['tags'] : 3; $show_popular_posts = isset( $instance['show_popular_posts'] ) && 'on' === $instance['show_popular_posts'] ? true : false; $show_recent_posts = isset( $instance['show_recent_posts'] ) && 'on' === $instance['show_recent_posts'] ? true : false; $show_comments = isset( $instance['show_comments'] ) && 'on' === $instance['show_comments'] ? true : false; $count_tabs = (int) $show_popular_posts + (int) $show_recent_posts + (int) $show_comments; if ( isset( $instance['orderby'] ) ) { $orderby = $instance['orderby']; } else { $orderby = 'comment_count'; } echo $before_widget; // WPCS: XSS ok. ?>
'classic', 'design_posts' => 'image_default', 'posts' => 3, 'comments' => '3', 'tags' => 3, 'show_popular_posts' => 'on', 'show_recent_posts' => 'on', 'show_comments' => 'on', 'orderby' => 'comments_count', ); $instance = wp_parse_args( (array) $instance, $defaults ); if ( 'Highest Comments' === $instance['orderby'] || 'comment_count' === $instance['orderby'] ) { $instance['orderby'] = 'comment_count'; } else { $instance['orderby'] = 'view_count'; } ?>

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

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

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