'grid', 'columns' => 3, 'limit' => -1, 'orderby' => 'title', 'order' => 'ASC', 'show_image' => 'yes', 'show_address' => 'yes', 'show_rooms_count' => 'yes', ), $atts, 'bnb_buildings' ); // Query buildings. $query_args = array( 'post_type' => Building::POST_TYPE, 'post_status' => 'publish', 'posts_per_page' => (int) $atts['limit'], 'orderby' => sanitize_text_field( $atts['orderby'] ), 'order' => strtoupper( $atts['order'] ) === 'DESC' ? 'DESC' : 'ASC', ); $buildings = get_posts( $query_args ); if ( empty( $buildings ) ) { return '

' . esc_html__( 'No buildings found.', 'wp-bnb' ) . '

'; } $layout = sanitize_text_field( $atts['layout'] ); $columns = max( 1, min( 4, (int) $atts['columns'] ) ); $classes = array( 'wp-bnb-buildings', 'wp-bnb-buildings-' . $layout, ); if ( 'grid' === $layout ) { $classes[] = 'wp-bnb-columns-' . $columns; } ob_start(); ?>
ID ); $room_count = count( $rooms ); ob_start(); ?>
ID ) ) : ?>
ID, 'medium_large' ); ?>

post_title ); ?>

ID, '_bnb_building_city', true ); $country = get_post_meta( $building->ID, '_bnb_building_country', true ); if ( $city || $country ) : $countries = Building::get_countries(); $country_name = $countries[ $country ] ?? $country; ?>

0 ) : ?>

ID ) ) : ?>
ID ) ); ?>
'grid', 'columns' => 3, 'limit' => 12, 'building_id' => 0, 'room_type' => '', 'amenities' => '', 'orderby' => 'title', 'order' => 'ASC', 'show_image' => 'yes', 'show_price' => 'yes', 'show_capacity' => 'yes', 'show_amenities' => 'yes', 'show_building' => 'yes', ), $atts, 'bnb_rooms' ); // Use search function for filtering. $search_args = array( 'building_id' => (int) $atts['building_id'], 'room_type' => sanitize_text_field( $atts['room_type'] ), 'amenities' => $atts['amenities'] ? explode( ',', $atts['amenities'] ) : array(), 'orderby' => sanitize_text_field( $atts['orderby'] ), 'order' => $atts['order'], 'limit' => (int) $atts['limit'], ); $rooms = Search::search( $search_args ); if ( empty( $rooms ) ) { return '

' . esc_html__( 'No rooms found.', 'wp-bnb' ) . '

'; } $layout = sanitize_text_field( $atts['layout'] ); $columns = max( 1, min( 4, (int) $atts['columns'] ) ); $classes = array( 'wp-bnb-rooms', 'wp-bnb-rooms-' . $layout, ); if ( 'grid' === $layout ) { $classes[] = 'wp-bnb-columns-' . $columns; } ob_start(); ?>
<?php echo esc_attr( $room['title'] ); ?>

,

4 ) : ?> +
'grid', 'columns' => 3, 'show_dates' => 'yes', 'show_guests' => 'yes', 'show_room_type' => 'yes', 'show_amenities' => 'yes', 'show_price_range' => 'yes', 'show_building' => 'yes', 'results_per_page' => 12, ), $atts, 'bnb_room_search' ); // Get search form data. $form_data = Search::get_search_form_data(); $layout = sanitize_text_field( $atts['layout'] ); $columns = max( 1, min( 4, (int) $atts['columns'] ) ); ob_start(); ?> 0, 'show_rooms' => 'yes', 'show_address' => 'yes', 'show_contact' => 'yes', ), $atts, 'bnb_building' ); $building_id = (int) $atts['id']; if ( ! $building_id ) { return '

' . esc_html__( 'Building ID is required.', 'wp-bnb' ) . '

'; } $building = get_post( $building_id ); if ( ! $building || Building::POST_TYPE !== $building->post_type ) { return '

' . esc_html__( 'Building not found.', 'wp-bnb' ) . '

'; } $show_rooms = 'yes' === $atts['show_rooms']; $show_address = 'yes' === $atts['show_address']; $show_contact = 'yes' === $atts['show_contact']; ob_start(); ?>
ID ) ) : ?>

post_title ); ?>

ID ); ?>

ID, '_bnb_building_phone', true ); $email = get_post_meta( $building->ID, '_bnb_building_email', true ); $website = get_post_meta( $building->ID, '_bnb_building_website', true ); ?>

ID, '_bnb_building_check_in_time', true ); $check_out_time = get_post_meta( $building->ID, '_bnb_building_check_out_time', true ); if ( $check_in_time || $check_out_time ) : ?>

post_content ) ) : ?>
post_content ) ); ?>
ID ); ?>

$building->ID, 'show_building' => 'no', 'limit' => -1, ) ); ?>
0, 'show_gallery' => 'yes', 'show_pricing' => 'yes', 'show_amenities' => 'yes', 'show_availability' => 'yes', ), $atts, 'bnb_room' ); $room_id = (int) $atts['id']; if ( ! $room_id ) { return '

' . esc_html__( 'Room ID is required.', 'wp-bnb' ) . '

'; } $room = get_post( $room_id ); if ( ! $room || Room::POST_TYPE !== $room->post_type ) { return '

' . esc_html__( 'Room not found.', 'wp-bnb' ) . '

'; } $show_gallery = 'yes' === $atts['show_gallery']; $show_pricing = 'yes' === $atts['show_pricing']; $show_amenities = 'yes' === $atts['show_amenities']; $show_availability = 'yes' === $atts['show_availability']; // Get room data. $room_data = Search::get_room_data( $room ); ob_start(); ?>
ID ) || ! empty( $room_data['gallery'] ) ) ) : ?>

post_title ); ?>

,

post_content ) ) : ?>
post_content ) ); ?>
ID ); ?>

value ]['price'] ?? null; ?>
label() ); ?> unit() ); ?>