'mag-lite-sidebar-latest-tab', 'description' => esc_html__( 'Add Widget to Display Tab Section .', 'mag-lite' ) ); parent::__construct( 'mag_lite_sidebar_latest_tab',esc_html__( 'ML: Sidebar Latest/Popular Tab', 'mag-lite' ), $widget_ops, $control_ops ); } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'category' => '', 'number' => 4, 'category_news' => '', 'number_news' => 4, ) ); $category = isset( $instance['category'] ) ? absint( $instance['category'] ) : 0; $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 4; $category_news = isset( $instance['category_news'] ) ? absint( $instance['category_news'] ) : 0; $number_news = isset( $instance['number_news'] ) ? absint( $instance['number_news'] ) : 4; ?>

'', 'show_option_all' => esc_html__('From Recent Post','mag-lite'), 'name' => esc_attr($this->get_field_name( 'category' )), 'selected' => absint( $category ), ) ); ?>

'', 'show_option_all' => esc_html__('From Recent Post','mag-lite'), 'name' => esc_attr($this->get_field_name( 'category_news' )), 'selected' => absint( $category_news ), ) ); ?>

absint( $number ), 'post_type' => 'post', 'post_status' => 'publish', ); if ( absint( $category ) > 0 ) { $category_args['cat'] = absint( $category ); } $the_query = new WP_Query( $category_args ); if ($the_query->have_posts()) : $cn = 0; while ( $the_query->have_posts() ) : $the_query->the_post(); $cn++;?>

absint( $number_news ), 'post_type' => 'post', 'post_status' => 'publish', ); if ( absint( $category_news ) > 0 ) { $category_news_args['cat'] = absint( $category_news ); } $the_query = new WP_Query( $category_news_args ); if ($the_query->have_posts()) : $cn = 0; while ( $the_query->have_posts() ) : $the_query->the_post(); $cn++;?>