'mag-lite-latest-tab', 'description' => esc_html__( 'Add Widget to Display Tab Section .', 'mag-lite' ) ); parent::__construct( 'mag_lite_latest_tab',esc_html__( 'ML: Home 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, 'show_post_meta' => true, ) ); $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $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_post_meta = isset( $instance['show_post_meta'] ) ? (bool) $instance['show_post_meta'] : true; ?>

'', 'class' => 'widefat', 'show_option_all' => esc_html__('Choose Option','mag-lite'), 'name' => esc_attr($this->get_field_name( 'category' )), 'selected' => absint( $category ), ) ); ?>

'', 'class' => 'widefat', 'show_option_all' => esc_html__('Choose Option','mag-lite'), 'name' => esc_attr($this->get_field_name( 'category_news' )), 'selected' => absint( $category_news ), ) ); ?>

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

absint( $number ), 'post_type' => 'post', 'post_status' => 'publish', 'orderby' => 'rand', 'order' => 'ASC', ); if ( absint( $category ) > 0 || absint( $category_news ) > 0 ) { $all_args['cat'] = array( absint( $category ), absint( $category_news ) ); } $the_query = new WP_Query( $all_args ); if ($the_query->have_posts()) : $cn = 0; while ( $the_query->have_posts() ) : $the_query->the_post(); $cn++;?>

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++;?>