'block-layout-a', 'description' => esc_html__( 'News Block Layout Two. Place it within "Frontpage News Layouts Area"', 'best-news' ) ); parent::__construct( 'news-block-layout-two', esc_html__( 'Bnews: News Block Layout 2', 'best-news' ), $opts ); } function form( $instance ) { $title = ! empty( $instance[ 'title' ] ) ? $instance[ 'title' ] : __('Layout 2','best-news'); $cat_1 = ! empty( $instance[ 'cat_1' ] ) ? $instance[ 'cat_1' ] : 0; $cat_2 = ! empty( $instance[ 'cat_2' ] ) ? $instance[ 'cat_2' ] : 0; $cat_3 = ! empty( $instance[ 'cat_3' ] ) ? $instance[ 'cat_3' ] : 0; $cat_4 = ! empty( $instance[ 'cat_4' ] ) ? $instance[ 'cat_4' ] : 0; $author_1 = ! empty( $instance[ 'author_1' ] ) ? $instance[ 'author_1' ] : 0; $orderby = ! empty( $instance[ 'orderby' ] ) ? $instance[ 'orderby' ] : 'date'; $post_no = ! empty( $instance[ 'post_no' ] ) ? $instance[ 'post_no' ] : 5; $layout_enable = ! empty( $instance[ 'layout_enable' ] ) ? $instance[ 'layout_enable' ] : 'off'; $button_enable = ! empty( $instance[ 'button_enable' ] ) ? $instance[ 'button_enable' ] : 'off'; ?>
id="get_field_id( 'layout_enable' )); ?>" name="get_field_name( 'layout_enable' ) ); ?>" />
id="get_field_id( 'button_enable' )); ?>" name="get_field_name( 'button_enable' ) ); ?>" />
__('All author ','best-news'),
'hide_if_only_one_author' => null, // string
'orderby' => 'display_name',
'order' => 'ASC',
'include' => null, // string
'exclude' => null, // string
'multi' => false,
'show' => 'display_name',
'echo' => true,
'selected' => $author_1,
'include_selected' => false,
'name' => esc_html( $this->get_field_name('author_1') ),
'id' => absint( $this->get_field_id('author_1') ),
'class' => null, // string
'blog_id' => $GLOBALS['blog_id'],
'who' => null, // string,
'role' => null, // string|array,
'role__in' => null, // array
'role__not_in' => null, // array
);
wp_dropdown_users($author_args_1);
?>
'name',
'hide_empty' => 1,
'show_count' => 1,
'hierarchical' => 1,
'id' => $this->get_field_id( 'cat_1' ),
'name' => $this->get_field_name( 'cat_1' ),
'class' => 'widefat',
'taxonomy' => 'category',
'selected' => absint( $cat_1 ),
);
wp_dropdown_categories( $cat_args_1 );
?>
'name', 'hide_empty' => 1, 'show_count' => 1, 'hierarchical' => 1, 'id' => $this->get_field_id( 'cat_2' ), 'name' => $this->get_field_name( 'cat_2' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat_2 ), ); wp_dropdown_categories( $cat_args_2 ); ?>
'name',
'hide_empty' => 1,
'show_count' => 1,
'hierarchical' => 1,
'id' => $this->get_field_id( 'cat_3' ),
'name' => $this->get_field_name( 'cat_3' ),
'class' => 'widefat',
'taxonomy' => 'category',
'selected' => absint( $cat_3 ),
);
wp_dropdown_categories( $cat_args_3 );
?>
'name',
'hide_empty' => 1,
'show_count' => 1,
'hierarchical' => 1,
'id' => $this->get_field_id( 'cat_4' ),
'name' => $this->get_field_name( 'cat_4' ),
'class' => 'widefat',
'taxonomy' => 'category',
'selected' => absint( $cat_4 ),
);
wp_dropdown_categories( $cat_args_4 );
?>
id_base ); $post_no = ! empty( $instance[ 'post_no' ] ) ? $instance[ 'post_no' ] : 5; $layout_enable_check = isset( $instance['layout_enable'] ) ? esc_attr( $instance['layout_enable'] ) : ''; $layout_enable = $layout_enable_check ? 'true' : 'false'; $button_enable_check = isset( $instance['button_enable'] ) ? esc_attr( $instance['button_enable'] ) : ''; $button_enable = $button_enable_check ? 'true' : 'false'; echo $args[ 'before_widget' ]; if($layout_enable =='true'): ?>