'business-hub-recent-posts, extended-widget', 'description' => __( 'A widget that displays your latest posts and thumbnail with extended features.', 'business-hub') ); parent::__construct('Business_Hub_Recent_Posts_Extended', __('Business Hub: Recent Post Extended', 'business-hub'), $widget_ops, $control_ops); } /** * Displays the Widget * */ function widget($args, $instance){ $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Recent Posts', 'business-hub' ); $number = ! empty( $instance['number'] ) ? absint( $instance['number']) : 5; $excerpt_length = ! empty( $instance['excerpt_length'] ) ? absint( $instance['excerpt_length']) : 8; $hide_meta = ! empty( $instance['hide_meta'] ) ? '1' : '0'; $rtrpe_args = array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ); $rtrpe_query = new WP_Query( apply_filters( 'widget_posts_args', $rtrpe_args ) ); if( $rtrpe_query->have_posts()): echo $args['before_widget']; if (isset($title)): echo $args['before_title'] . esc_html( $title ) . $args['after_title']; endif; while ( $rtrpe_query->have_posts() ) : $rtrpe_query->the_post(); ?>

'', 'number' => '5', 'excerpt_length' => '8', 'hide_meta' => false, ) ); $title = isset( $instance['title'] ) ? $instance['title'] : ''; $number = !empty( $instance['number']) ? $instance['number'] : '5'; $excerpt_length = !empty( $instance['excerpt_length']) ? $instance['excerpt_length'] : '8'; $hide_meta = isset( $instance['hide_meta']) ? (bool) $instance['hide_meta'] : false; # Output the options ?>

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