start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'best-hotel' ), ] ); $this->add_responsive_control( 'columns', [ 'label' => __( 'Columns', 'best-hotel' ), 'type' => Controls_Manager::SELECT, 'default' => '3', 'tablet_default' => '2', 'mobile_default' => '1', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', ], 'prefix_class' => 'elementor-grid%s-', 'frontend_available' => true, 'selectors' => [ '.elementor-msie {{WRAPPER}} .elementor-portfolio-item' => 'width: calc( 100% / {{SIZE}} )', ], ] ); $this->add_control( 'posts_per_page', [ 'label' => __( 'Posts Per Page', 'best-hotel' ), 'type' => Controls_Manager::NUMBER, 'default' => 3, ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'post_thumbnail', 'exclude' => [ 'custom' ], 'default' => 'large', 'prefix_class' => 'post-thumbnail-size-', ] ); $this->end_controls_section(); } /** * Render the widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $args = array( 'number' => absint( $settings['posts_per_page'] ) ); $rooms = best_hotel_get_rooms( $args ); ?>
<?php echo esc_attr( $room['name'] ); ?> <?php echo esc_attr( $room['name'] ); ?>