Changeset 3400977
- Timestamp:
- 11/22/2025 02:40:38 PM (4 months ago)
- Location:
- wp-hotelier/trunk
- Files:
-
- 6 edited
-
hotelier.php (modified) (2 diffs)
-
includes/admin/class-htl-admin-post-types.php (modified) (3 diffs)
-
includes/admin/meta-boxes/class-htl-meta-box-reservation-data.php (modified) (2 diffs)
-
includes/admin/new-reservation/class-htl-admin-new-reservation.php (modified) (4 diffs)
-
includes/htl-reservation-functions.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-hotelier/trunk/hotelier.php
r3381523 r3400977 4 4 * Plugin URI: https://wphotelier.com/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=wphotelierplugin 5 5 * Description: Hotel booking plugin for WordPress. 6 * Version: 2.1 6.06 * Version: 2.17.0 7 7 * Author: WP Hotelier 8 8 * Author URI: https://wphotelier.com/ … … 32 32 * @var string 33 33 */ 34 public $version = '2.1 6.0';34 public $version = '2.17.0'; 35 35 36 36 /** -
wp-hotelier/trunk/includes/admin/class-htl-admin-post-types.php
r2575390 r3400977 6 6 * @category Admin 7 7 * @package Hotelier/Admin 8 * @version 2. 6.08 * @version 2.17.0 9 9 */ 10 10 … … 167 167 $columns = array(); 168 168 $columns[ 'title' ] = esc_html__( 'Guest', 'wp-hotelier' ); 169 $columns[ 'rooms' ] = esc_html__( 'Rooms', 'wp-hotelier' ); 169 170 $columns[ 'nights' ] = esc_html__( 'Nights', 'wp-hotelier' ); 170 171 $columns[ 'check_in' ] = esc_html__( 'Check-in', 'wp-hotelier' ); … … 187 188 188 189 switch ( $column ) { 190 case 'rooms' : 191 $line_items = $the_reservation->get_items(); 192 $room_links = array(); 193 194 foreach ( $line_items as $item_id => $item ) { 195 $_room = $the_reservation->get_room_from_item( $item ); 196 197 if ( $_room->exists() ) { 198 $room_links[] = sprintf( '<a href="%s">%s</a>', get_edit_post_link( $item['room_id'] ), $item['name'] ); 199 } else { 200 $room_links[] = $item['name']; 201 } 202 } 203 204 echo '<span>' . implode( ', ', $room_links ) . '</span>'; 205 break; 206 189 207 case 'nights' : 190 208 echo '<span>' . absint( $the_reservation->get_nights() ) . '</span>'; -
wp-hotelier/trunk/includes/admin/meta-boxes/class-htl-meta-box-reservation-data.php
r2958683 r3400977 6 6 * @category Admin 7 7 * @package Hotelier/Admin/Meta Boxes 8 * @version 2.1 0.08 * @version 2.17.0 9 9 */ 10 10 … … 196 196 197 197 <?php if ( ( get_post_meta( $post->ID, '_created_via', true ) == 'admin' ) ) : ?> 198 <span class="booking-details__created-by-admin"><?php esc_html_e( '(created by admin)', 'wp-hotelier' ); ?></span> 198 <?php 199 $admin_name = esc_html__( 'admin', 'wp-hotelier' ); 200 $creator_id = get_post_meta( $post->ID, '_admin_creator', true ); 201 202 if ( $creator_id ) { 203 $creator_obj = get_user_by( 'id', $creator_id ); 204 205 if ( isset( $creator_obj->display_name ) ) { 206 $admin_name = $creator_obj->display_name; 207 } 208 } 209 ?> 210 <span class="booking-details__created-by-admin"><?php echo sprintf( esc_html__( '(created by %s)', 'wp-hotelier' ), $admin_name ); ?></span> 199 211 <?php endif; ?> 200 212 -
wp-hotelier/trunk/includes/admin/new-reservation/class-htl-admin-new-reservation.php
r2681452 r3400977 6 6 * @category Admin 7 7 * @package Hotelier/Admin 8 * @version 2. 7.18 * @version 2.17.0 9 9 */ 10 10 … … 231 231 232 232 try { 233 $current_user = wp_get_current_user(); 234 233 235 // Start transaction if available 234 236 $wpdb->query( 'START TRANSACTION' ); … … 239 241 'email' => self::get_form_data_field( 'email' ), 240 242 'special_requests' => self::get_form_data_field( 'special_requests' ), 241 'created_via' => 'admin' 243 'created_via' => 'admin', 244 'admin_creator' => $current_user->ID 242 245 ); 243 246 … … 371 374 372 375 // Add a note to the reservation 373 $reservation->add_reservation_note( esc_html__( 'Reservation manually created by admin.', 'wp-hotelier' ) ); 376 $admin_name = $current_user->display_name ? $current_user->display_name : esc_html__( 'admin', 'wp-hotelier' ); 377 $reservation->add_reservation_note( sprintf( esc_html__( 'Reservation manually created by %s.', 'wp-hotelier' ), $admin_name ) ); 374 378 375 379 // If we got here, the reservation was created without problems! -
wp-hotelier/trunk/includes/htl-reservation-functions.php
r2260556 r3400977 6 6 * @category Core 7 7 * @package Hotelier/Functions 8 * @version 2. 2.08 * @version 2.17.0 9 9 */ 10 10 … … 38 38 'reservation_id' => 0, 39 39 'created_via' => '', 40 'admin_creator' => '', 40 41 'parent' => 0 41 42 ); … … 88 89 update_post_meta( $reservation_id, '_reservation_currency', htl_get_currency() ); 89 90 update_post_meta( $reservation_id, '_created_via', sanitize_text_field( $args[ 'created_via' ] ) ); 91 92 if ( isset( $args[ 'admin_creator' ] ) ) { 93 update_post_meta( $reservation_id, '_admin_creator', sanitize_text_field( $args[ 'admin_creator' ] ) ); 94 } 90 95 } 91 96 -
wp-hotelier/trunk/readme.txt
r3381523 r3400977 4 4 Requires at least: 4.1 5 5 Tested up to: 6.8 6 Stable tag: 2.1 6.06 Stable tag: 2.17.0 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 131 131 == Changelog == 132 132 133 = 2.17.0 - 2025-11-22 = 134 * Add - Display rooms included in reservation 135 * Add - Display creator name for manual reservations 136 133 137 = 2.16.0 - 2025-10-18 = 134 138 * Add - Ability to clear logs from admin.
Note: See TracChangeset
for help on using the changeset viewer.