'widget_editor_choice', 'description' => esc_html__( 'Retrive latest posts.', 'bloghill' ), ); parent::__construct( 'bloghill_editor_choice', esc_html__( 'TP : Editor Choice', 'bloghill' ), $tp_widget_editor_choice ); } /** * Outputs the content of the widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { // outputs the content of the widget if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $tp_title = ( ! empty( $instance['title'] ) ) ? ( $instance['title'] ) : ''; $tp_title = apply_filters( 'widget_title', $tp_title, $instance, $this->id_base ); $tp_number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; $tp_category = isset( $instance['category'] ) ? absint( $instance['category'] ) : ''; echo $args['before_widget']; if ( ! empty( $tp_title ) ) { ?>
'post', 'posts_per_page' => absint($tp_number), 'order' => 'DESC', 'cat' => absint( $tp_category ), ); echo '