'widget_recent_data', 'description' => esc_html__( 'The most recent posts on your site.', 'cyber' ), 'customize_selective_refresh' => true, ); parent::__construct( 'em_recent_post_widget', esc_html__( 'EM Recent Posts','cyber' ), $widget_ops ); $this->alt_option_name = 'widget_recent_data'; } /* --------------------------------------------------------------------------- * Outputs the HTML for this widget. * --------------------------------------------------------------------------- */ public function widget( $args, $instance ) { if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = null; extract( $args, EXTR_SKIP ); echo $before_widget; $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base); ?>
$instance['count'] ? intval($instance['count']) : 0, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ); $r = new WP_Query( apply_filters( 'widget_posts_args', $args ) ); if ($r->have_posts()){ while ( $r->have_posts() ){ $r->the_post(); ?>