esc_html__( 'A widget that show the most highlighted quotes from posts', 'actify' ), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Highlights', 'actify' ); /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5; $min_count = ( ! empty( $instance['min_count'] ) ) ? absint( $instance['min_count'] ) : 5; if ( ! $number ) { $number = 5; } $show_number_of_counts = isset( $instance['show_number_of_counts'] ) ? $instance['show_number_of_counts'] : false; /** * Filters the arguments for the Highlighted Posts widget. * * @since 3.4.0 * * @see WP_Query::get_posts() * * @param array $args An array of arguments used to retrieve the highlight posts. */ $r = new WP_Query( apply_filters( 'widget_actify_highlights_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'post_type' => 'actify_highlights', 'ignore_sticky_posts' => true, 'meta_key' => 'highlight_from', 'meta_query' => array( array( 'key' => 'highlight_counts', 'value' => $min_count, 'compare' => '>=', ) ) ) ) ); if ( $r->have_posts() ) : ?>
id="get_field_id( 'show_number_of_counts' ); ?>" name="get_field_name( 'show_number_of_counts' ); ?>"/>