'tg_widget_recent_posts', 'description' => esc_html__( 'Shows recent posts with an image', 'cenote' ), 'customize_selective_refresh' => true, ); parent::__construct( 'tg-recent-posts', esc_html__( 'TG: Recent Posts', 'cenote' ), $widget_ops ); $this->alt_option_name = 'tg_widget_recent_posts'; } /** * Output the html markup * * @param array $args display arguments. * @param array $instance settings for the current. * * @return void */ public function widget( $args, $instance ) { if ( ! isset( $args ['widget_id'] ) ) { $args['widget_id'] = $this->id; } $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : esc_html__( 'Recent Posts', 'cenote' ); $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5; if ( ! $number ) { $number = 5; } $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; $r = new WP_Query( apply_filters( 'cenote_widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, ), $instance ) ); if ( ! $r->have_posts() ) { return; } ?>

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