Changeset 2917865
- Timestamp:
- 05/26/2023 03:12:35 PM (3 years ago)
- Location:
- woocommerce-accommodation-bookings
- Files:
-
- 22 edited
- 1 copied
-
tags/1.1.41 (copied) (copied from woocommerce-accommodation-bookings/trunk)
-
tags/1.1.41/changelog.txt (modified) (1 diff)
-
tags/1.1.41/includes/admin/class-wc-accommodation-booking-admin-panels.php (modified) (10 diffs)
-
tags/1.1.41/includes/admin/class-wc-accommodation-booking-admin-product-settings.php (modified) (1 diff)
-
tags/1.1.41/includes/admin/views/html-accommodation-booking-availability-fields.php (modified) (2 diffs)
-
tags/1.1.41/includes/admin/views/html-accommodation-booking-availability.php (modified) (3 diffs)
-
tags/1.1.41/includes/admin/views/html-accommodation-booking-data.php (modified) (1 diff)
-
tags/1.1.41/includes/admin/views/html-accommodation-booking-rates-fields.php (modified) (2 diffs)
-
tags/1.1.41/includes/admin/views/html-accommodation-booking-tabs.php (modified) (1 diff)
-
tags/1.1.41/languages/woocommerce-accommodation-bookings.pot (modified) (4 diffs)
-
tags/1.1.41/readme.txt (modified) (2 diffs)
-
tags/1.1.41/woocommerce-accommodation-bookings.php (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/includes/admin/class-wc-accommodation-booking-admin-panels.php (modified) (10 diffs)
-
trunk/includes/admin/class-wc-accommodation-booking-admin-product-settings.php (modified) (1 diff)
-
trunk/includes/admin/views/html-accommodation-booking-availability-fields.php (modified) (2 diffs)
-
trunk/includes/admin/views/html-accommodation-booking-availability.php (modified) (3 diffs)
-
trunk/includes/admin/views/html-accommodation-booking-data.php (modified) (1 diff)
-
trunk/includes/admin/views/html-accommodation-booking-rates-fields.php (modified) (2 diffs)
-
trunk/includes/admin/views/html-accommodation-booking-tabs.php (modified) (1 diff)
-
trunk/languages/woocommerce-accommodation-bookings.pot (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/woocommerce-accommodation-bookings.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-accommodation-bookings/tags/1.1.41/changelog.txt
r2911748 r2917865 1 1 *** Changelog *** 2 3 = 1.1.41 - 2023-05-26 = 4 * Dev - Add product unit filter, `wc_bookings_product_duration_fallback`, to add night unit support. 5 * Dev - Fix linting errors found by the Quality Insights Toolkit. 2 6 3 7 = 1.1.40 - 2023-05-12 = -
woocommerce-accommodation-bookings/tags/1.1.41/includes/admin/class-wc-accommodation-booking-admin-panels.php
r2815380 r2917865 15 15 add_filter( 'product_type_selector', array( $this, 'product_type_selector' ) ); 16 16 add_filter( 'product_type_options', array( $this, 'product_type_options' ), 15 ); 17 add_filter( 'wc_bookings_product_duration_fallback', array( $this, 'get_product_duration' ), 10, 3 ); 17 18 18 19 add_action( 'woocommerce_product_data_panels', array( $this, 'panels' ) ); … … 23 24 24 25 add_action( 'woocommerce_process_product_meta', array( $this,'save_product_data' ), 25 ); 26 } 27 28 /** 29 * Filters product unit to display. 30 * 31 * @param string $duration_unit_default Default fallback duration 32 * @param string $duration_unit Current duration unit 33 * @param int $duration Duration of booking 34 * 35 * @return string 36 */ 37 public function get_product_duration( $duration_unit_default, $duration_unit, $duration ) { 38 if ( 'night' === $duration_unit ) { 39 return _n( 'night', 'nights', $duration, 'woocommerce-accommodation-bookings' ); 40 } 41 return $duration_unit_default; 25 42 } 26 43 … … 154 171 155 172 foreach ( $meta_to_save as $meta_key => $sanitize ) { 156 $value = ! empty( $_POST[ $meta_key ] ) ? $_POST[ $meta_key ] : '';173 $value = sanitize_text_field( wp_unslash( $_POST[ $meta_key ] ?? '' ) ); 157 174 switch ( $sanitize ) { 158 175 case 'int' : … … 174 191 } 175 192 break; 176 default :177 $value = sanitize_text_field( $value );178 193 } 179 194 … … 202 217 $availability[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_from_date' ][ $i ] ); 203 218 $availability[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_to_date' ][ $i ] ); 204 break;219 break; 205 220 case 'months' : 206 221 $availability[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_from_month' ][ $i ] ); 207 222 $availability[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_to_month' ][ $i ] ); 208 break;223 break; 209 224 case 'weeks' : 210 225 $availability[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_from_week' ][ $i ] ); 211 226 $availability[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_to_week' ][ $i ] ); 212 break;227 break; 213 228 case 'days' : 214 229 $availability[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_from_day_of_week' ][ $i ] ); 215 230 $availability[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_to_day_of_week' ][ $i ] ); 216 break;231 break; 217 232 } 218 233 } … … 226 241 // Resources 227 242 if ( isset( $_POST['resource_id'] ) && isset( $_POST['_wc_booking_has_resources'] ) ) { 228 $resource_ids = $_POST['resource_id']; 229 $resource_menu_order = $_POST['resource_menu_order']; 230 $resource_base_cost = $_POST['resource_cost']; 231 $resource_block_cost = $_POST['resource_block_cost']; 232 $max_loop = max( array_keys( $_POST['resource_id'] ) ); 243 $resource_data = filter_input_array( 244 INPUT_POST, 245 array( 246 'resource_id' => array( 247 'filter' => FILTER_VALIDATE_INT, 248 'flags' => FILTER_REQUIRE_ARRAY, 249 ), 250 'resource_menu_order' => array( 251 'filter' => FILTER_VALIDATE_INT, 252 'flags' => FILTER_REQUIRE_ARRAY, 253 ), 254 'resource_cost' => array( 255 'filter' => FILTER_VALIDATE_FLOAT, 256 'flags' => FILTER_REQUIRE_ARRAY, 257 ), 258 'resource_block_cost' => array( 259 'filter' => FILTER_VALIDATE_FLOAT, 260 'flags' => FILTER_REQUIRE_ARRAY, 261 ), 262 ) 263 ); 264 $resource_ids = $resource_data['resource_id']; 265 $resource_menu_order = $resource_data['resource_menu_order']; 266 $resource_base_cost = $resource_data['resource_cost']; 267 $resource_block_cost = $resource_data['resource_block_cost']; 268 269 $max_loop = max( array_keys( $resource_ids ) ); 270 233 271 $resource_base_costs = array(); 234 272 $resource_block_costs = array(); … … 244 282 "{$wpdb->prefix}wc_booking_relationships", 245 283 array( 246 'sort_order' => $resource_menu_order[ $i ]284 'sort_order' => absint( $resource_menu_order[ $i ] ), 247 285 ), 248 286 array( 249 287 'product_id' => $post_id, 250 'resource_id' => $resource_id 288 'resource_id' => $resource_id, 251 289 ) 252 290 ); … … 263 301 update_post_meta( $post_id, '_resource_block_costs', $resource_block_costs ); 264 302 } 265 303 266 304 // Rates 267 305 $pricing = array(); … … 280 318 $pricing[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_from_date' ][ $i ] ); 281 319 $pricing[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_to_date' ][ $i ] ); 282 break;320 break; 283 321 case 'months' : 284 322 $pricing[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_from_month' ][ $i ] ); 285 323 $pricing[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_to_month' ][ $i ] ); 286 break;324 break; 287 325 case 'weeks' : 288 326 $pricing[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_from_week' ][ $i ] ); 289 327 $pricing[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_to_week' ][ $i ] ); 290 break;328 break; 291 329 case 'days' : 292 330 $pricing[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_from_day_of_week' ][ $i ] ); 293 331 $pricing[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_to_day_of_week' ][ $i ] ); 294 break;295 } 296 } 297 332 break; 333 } 334 } 335 298 336 // Person Types 299 337 if ( isset( $_POST['person_id'] ) && isset( $_POST['_wc_booking_has_persons'] ) ) { 300 $person_ids = $_POST['person_id']; 301 $person_menu_order = $_POST['person_menu_order']; 302 $person_name = $_POST['person_name']; 303 $person_cost = $_POST['person_cost']; 304 $person_block_cost = $_POST['person_block_cost']; 305 $person_description = $_POST['person_description']; 306 $person_min = $_POST['person_min']; 307 $person_max = $_POST['person_max']; 308 309 $max_loop = max( array_keys( $_POST['person_id'] ) ); 338 $person_data = filter_input_array( 339 INPUT_POST, 340 array( 341 'person_id' => array( 342 'filter' => FILTER_VALIDATE_INT, 343 'flags' => FILTER_REQUIRE_ARRAY, 344 ), 345 'person_menu_order' => array( 346 'filter' => FILTER_VALIDATE_INT, 347 'flags' => FILTER_REQUIRE_ARRAY, 348 ), 349 'person_name' => array( 350 'filter' => FILTER_DEFAULT, 351 'flags' => FILTER_REQUIRE_ARRAY, 352 ), 353 'person_cost' => array( 354 'filter' => FILTER_VALIDATE_FLOAT, 355 'flags' => FILTER_REQUIRE_ARRAY, 356 ), 357 'person_block_cost' => array( 358 'filter' => FILTER_VALIDATE_FLOAT, 359 'flags' => FILTER_REQUIRE_ARRAY, 360 ), 361 'person_description' => array( 362 'filter' => FILTER_DEFAULT, 363 'flags' => FILTER_REQUIRE_ARRAY, 364 ), 365 'person_min' => array( 366 'filter' => FILTER_VALIDATE_INT, 367 'flags' => FILTER_REQUIRE_ARRAY, 368 ), 369 'person_max' => array( 370 'filter' => FILTER_VALIDATE_INT, 371 'flags' => FILTER_REQUIRE_ARRAY, 372 ), 373 ) 374 ); 375 $person_ids = $person_data['person_id']; 376 $person_menu_order = $person_data['person_menu_order']; 377 $person_name = $person_data['person_name']; 378 $person_cost = $person_data['person_cost']; 379 $person_block_cost = $person_data['person_block_cost']; 380 $person_description = $person_data['person_description']; 381 $person_min = $person_data['person_min']; 382 $person_max = $person_data['person_max']; 383 384 $max_loop = max( array_keys( $person_ids ) ); 310 385 311 386 for ( $i = 0; $i <= $max_loop; $i ++ ) { … … 320 395 } 321 396 322 $wpdb->update( 323 $wpdb->posts, 397 wp_update_post( 324 398 array( 399 'ID' => $person_id, 325 400 'post_title' => stripslashes( $person_name[ $i ] ), 326 401 'post_excerpt' => stripslashes( $person_description[ $i ] ), 327 'menu_order' => $person_menu_order[ $i ] ), 328 array( 329 'ID' => $person_id 330 ), 331 array( 332 '%s', 333 '%s', 334 '%d' 335 ), 336 array( '%d' ) 402 'menu_order' => $person_menu_order[ $i ], 403 ) 337 404 ); 338 405 -
woocommerce-accommodation-bookings/tags/1.1.41/includes/admin/class-wc-accommodation-booking-admin-product-settings.php
r2736571 r2917865 219 219 <label for="<?php echo esc_attr( $field_key ); ?>"><?php echo esc_html( $value['title'] ); ?></label> 220 220 </th> 221 <td class="forminp forminp-<?php echo sanitize_title( $value['type']) ?>">221 <td class="forminp forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ) ?>"> 222 222 <input 223 223 name="<?php echo esc_attr( $field_key ); ?>" -
woocommerce-accommodation-bookings/tags/1.1.41/includes/admin/views/html-accommodation-booking-availability-fields.php
r1322513 r2917865 44 44 <div class="select wc_booking_availability_type"> 45 45 <select name="wc_accommodation_booking_availability_type[]"> 46 <option value="custom" <?php selected( $availability['type'], 'custom' ); ?>><?php _e( 'Custom date range', 'woocommerce-accommodation-bookings' ); ?></option>47 <option value="months" <?php selected( $availability['type'], 'months' ); ?>><?php _e( 'Range of months', 'woocommerce-accommodation-bookings' ); ?></option>48 <option value="weeks" <?php selected( $availability['type'], 'weeks' ); ?>><?php _e( 'Range of weeks', 'woocommerce-accommodation-bookings' ); ?></option>49 <option value="days" <?php selected( $availability['type'], 'days' ); ?>><?php _e( 'Range of days', 'woocommerce-accommodation-bookings' ); ?></option>46 <option value="custom" <?php selected( $availability['type'], 'custom' ); ?>><?php esc_html_e( 'Custom date range', 'woocommerce-accommodation-bookings' ); ?></option> 47 <option value="months" <?php selected( $availability['type'], 'months' ); ?>><?php esc_html_e( 'Range of months', 'woocommerce-accommodation-bookings' ); ?></option> 48 <option value="weeks" <?php selected( $availability['type'], 'weeks' ); ?>><?php esc_html_e( 'Range of weeks', 'woocommerce-accommodation-bookings' ); ?></option> 49 <option value="days" <?php selected( $availability['type'], 'days' ); ?>><?php esc_html_e( 'Range of days', 'woocommerce-accommodation-bookings' ); ?></option> 50 50 </select> 51 51 </div> … … 106 106 <div class="select"> 107 107 <select name="wc_accommodation_booking_availability_bookable[]"> 108 <option value="no" <?php selected( isset( $availability['bookable'] ) && $availability['bookable'] == 'no', true ) ?>><?php _e( 'No', 'woocommerce-accommodation-bookings' ) ;?></option>109 <option value="yes" <?php selected( isset( $availability['bookable'] ) && $availability['bookable'] == 'yes', true ) ?>><?php _e( 'Yes', 'woocommerce-accommodation-bookings' ) ;?></option>108 <option value="no" <?php selected( isset( $availability['bookable'] ) && $availability['bookable'] == 'no', true ) ?>><?php esc_html_e( 'No', 'woocommerce-accommodation-bookings' ) ;?></option> 109 <option value="yes" <?php selected( isset( $availability['bookable'] ) && $availability['bookable'] == 'yes', true ) ?>><?php esc_html_e( 'Yes', 'woocommerce-accommodation-bookings' ) ;?></option> 110 110 </select> 111 111 </div> -
woocommerce-accommodation-bookings/tags/1.1.41/includes/admin/views/html-accommodation-booking-availability.php
r2621336 r2917865 10 10 ?> 11 11 <p class="form-field"> 12 <label for="_wc_accommodation_booking_min_date"><?php _e( 'Bookings can be made starting', 'woocommerce-accommodation-bookings' ); ?></label>12 <label for="_wc_accommodation_booking_min_date"><?php esc_html_e( 'Bookings can be made starting', 'woocommerce-accommodation-bookings' ); ?></label> 13 13 <input type="number" name="_wc_accommodation_booking_min_date" id="_wc_accommodation_booking_min_date" value="<?php echo esc_attr( $min_date ); ?>" step="1" min="0" style="margin-right: 7px; width: 4em;"> 14 14 <select name="_wc_accommodation_booking_min_date_unit" id="_wc_accommodation_booking_min_date_unit" class="short" style="margin-right: 7px;"> 15 <option value="month" <?php selected( $min_date_unit, 'month' ); ?>><?php _e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option>16 <option value="week" <?php selected( $min_date_unit, 'week' ); ?>><?php _e( 'Week(s)', 'woocommerce-accommodation-bookings' ); ?></option>17 <option value="day" <?php selected( $min_date_unit, 'day' ); ?>><?php _e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option>18 </select> <?php _e( 'into the future', 'woocommerce-accommodation-bookings' ); ?>15 <option value="month" <?php selected( $min_date_unit, 'month' ); ?>><?php esc_html_e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option> 16 <option value="week" <?php selected( $min_date_unit, 'week' ); ?>><?php esc_html_e( 'Week(s)', 'woocommerce-accommodation-bookings' ); ?></option> 17 <option value="day" <?php selected( $min_date_unit, 'day' ); ?>><?php esc_html_e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option> 18 </select> <?php esc_html_e( 'into the future', 'woocommerce-accommodation-bookings' ); ?> 19 19 </p> 20 20 <?php … … 27 27 ?> 28 28 <p class="form-field"> 29 <label for="_wc_accommodation_booking_max_date"><?php _e( 'Bookings can only be made', 'woocommerce-accommodation-bookings' ); ?></label>29 <label for="_wc_accommodation_booking_max_date"><?php esc_html_e( 'Bookings can only be made', 'woocommerce-accommodation-bookings' ); ?></label> 30 30 <input type="number" name="_wc_accommodation_booking_max_date" id="_wc_accommodation_booking_max_date" value="<?php echo esc_attr( $max_date ); ?>" step="1" min="1" style="margin-right: 7px; width: 4em;"> 31 31 <select name="_wc_accommodation_booking_max_date_unit" id="_wc_accommodation_booking_max_date_unit" class="short" style="margin-right: 7px;"> 32 <option value="month" <?php selected( $max_date_unit, 'month' ); ?>><?php _e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option>33 <option value="week" <?php selected( $max_date_unit, 'week' ); ?>><?php _e( 'Week(s)', 'woocommerce-accommodation-bookings' ); ?></option>34 <option value="day" <?php selected( $max_date_unit, 'day' ); ?>><?php _e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option>35 </select> <?php _e( 'into the future', 'woocommerce-accommodation-bookings' ); ?>32 <option value="month" <?php selected( $max_date_unit, 'month' ); ?>><?php esc_html_e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option> 33 <option value="week" <?php selected( $max_date_unit, 'week' ); ?>><?php esc_html_e( 'Week(s)', 'woocommerce-accommodation-bookings' ); ?></option> 34 <option value="day" <?php selected( $max_date_unit, 'day' ); ?>><?php esc_html_e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option> 35 </select> <?php esc_html_e( 'into the future', 'woocommerce-accommodation-bookings' ); ?> 36 36 </p> 37 37 … … 70 70 ); 71 71 72 for ( $i=0; $i < 7; $i++) { 72 for ( $i=0; $i < 7; $i++) { 73 73 ?> 74 74 <td> 75 <label class="checkbox" for="_wc_accommodation_booking_restricted_days[<?php echo $i; ?>]" style="width: auto;"><?php echo $weekdays[ $i ]; ?> </label>76 <input type="checkbox" class="checkbox" name="_wc_accommodation_booking_restricted_days[<?php echo $i; ?>]" id="_wc_accommodation_booking_restricted_days[<?php echo $i; ?>]" value="<?php echo $i; ?>" <?php checked( $restricted_days[ $i ], $i ); ?>>75 <label class="checkbox" for="_wc_accommodation_booking_restricted_days[<?php echo esc_attr( $i ); ?>]" style="width: auto;"><?php echo esc_html( $weekdays[ $i ] ); ?> </label> 76 <input type="checkbox" class="checkbox" name="_wc_accommodation_booking_restricted_days[<?php echo esc_attr( $i ); ?>]" id="_wc_accommodation_booking_restricted_days[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $i ); ?>" <?php checked( $restricted_days[ $i ], $i ); ?>> 77 77 </td> 78 78 <?php -
woocommerce-accommodation-bookings/tags/1.1.41/includes/admin/views/html-accommodation-booking-data.php
r1768725 r2917865 63 63 ?> 64 64 <p class="form-field accommodation-booking-cancel-limit"> 65 <label for="_wc_accommodation_booking_cancel_limit"><?php _e( 'Cancellation up till', 'woocommerce-accommodation-bookings' ); ?></label>65 <label for="_wc_accommodation_booking_cancel_limit"><?php esc_html_e( 'Cancellation up till', 'woocommerce-accommodation-bookings' ); ?></label> 66 66 <input type="number" name="_wc_accommodation_booking_cancel_limit" id="_wc_accommodation_booking_cancel_limit" value="<?php echo esc_attr( $cancel_limit ); ?>" step="1" min="1" style="margin-right: 7px; width: 4em;"> 67 67 <select name="_wc_accommodation_booking_cancel_limit_unit" id="_wc_accommodation_booking_cancel_limit_unit" class="short" style="width: auto; margin-right: 7px;"> 68 <option value="month" <?php selected( $cancel_limit_unit, 'month' ); ?>><?php _e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option>69 <option value="day" <?php selected( $cancel_limit_unit, 'day' ); ?>><?php _e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option>70 <option value="hour" <?php selected( $cancel_limit_unit, 'hour' ); ?>><?php _e( 'Hour(s)', 'woocommerce-accommodation-bookings' ); ?></option>71 <option value="minute" <?php selected( $cancel_limit_unit, 'minute' ); ?>><?php _e( 'Minute(s)', 'woocommerce-accommodation-bookings' ); ?></option>68 <option value="month" <?php selected( $cancel_limit_unit, 'month' ); ?>><?php esc_html_e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option> 69 <option value="day" <?php selected( $cancel_limit_unit, 'day' ); ?>><?php esc_html_e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option> 70 <option value="hour" <?php selected( $cancel_limit_unit, 'hour' ); ?>><?php esc_html_e( 'Hour(s)', 'woocommerce-accommodation-bookings' ); ?></option> 71 <option value="minute" <?php selected( $cancel_limit_unit, 'minute' ); ?>><?php esc_html_e( 'Minute(s)', 'woocommerce-accommodation-bookings' ); ?></option> 72 72 </select> 73 <span class="description"><?php _e( 'before check-in.', 'woocommerce-accommodation-bookings' ); ?></span>73 <span class="description"><?php esc_html_e( 'before check-in.', 'woocommerce-accommodation-bookings' ); ?></span> 74 74 </p> 75 75 -
woocommerce-accommodation-bookings/tags/1.1.41/includes/admin/views/html-accommodation-booking-rates-fields.php
r2856041 r2917865 41 41 <div class="select wc_booking_availability_type"> 42 42 <select name="wc_accommodation_booking_pricing_type[]"> 43 <option value="custom" <?php selected( $rate['type'], 'custom' ); ?>><?php _e( 'Range of certain nights', 'woocommerce-accommodation-bookings' ); ?></option>44 <option value="months" <?php selected( $rate['type'], 'months' ); ?>><?php _e( 'Range of months', 'woocommerce-accommodation-bookings' ); ?></option>45 <option value="weeks" <?php selected( $rate['type'], 'weeks' ); ?>><?php _e( 'Range of weeks', 'woocommerce-accommodation-bookings' ); ?></option>46 <option value="days" <?php selected( $rate['type'], 'days' ); ?>><?php _e( 'Range of nights during the week', 'woocommerce-accommodation-bookings' ); ?></option>43 <option value="custom" <?php selected( $rate['type'], 'custom' ); ?>><?php esc_html_e( 'Range of certain nights', 'woocommerce-accommodation-bookings' ); ?></option> 44 <option value="months" <?php selected( $rate['type'], 'months' ); ?>><?php esc_html_e( 'Range of months', 'woocommerce-accommodation-bookings' ); ?></option> 45 <option value="weeks" <?php selected( $rate['type'], 'weeks' ); ?>><?php esc_html_e( 'Range of weeks', 'woocommerce-accommodation-bookings' ); ?></option> 46 <option value="days" <?php selected( $rate['type'], 'days' ); ?>><?php esc_html_e( 'Range of nights during the week', 'woocommerce-accommodation-bookings' ); ?></option> 47 47 </select> 48 48 </div> … … 108 108 // Handle legacy 109 109 if ( ! empty( $rate['override_block'] ) ) { 110 echo $rate['override_block'];110 echo esc_attr( $rate['override_block'] ); 111 111 } else if ( ! empty( $rate['modifier'] ) && isset( $rate['cost'] ) ) { 112 112 $base_cost = abs( floatval( get_post_meta( $post_id, '_wc_booking_base_cost', true ) ) ); 113 113 114 114 if ( 'plus' == $rate['modifier'] ) { 115 echo $base_cost + $rate['cost'];115 echo esc_attr( $base_cost + $rate['cost'] ); 116 116 } else { 117 echo $base_cost - $rate['cost'];117 echo esc_attr( $base_cost - $rate['cost'] ); 118 118 } 119 119 } -
woocommerce-accommodation-bookings/tags/1.1.41/includes/admin/views/html-accommodation-booking-tabs.php
r1644960 r2917865 1 <li class="accommodation_bookings_tab accommodation_bookings_availability_tab bookings_availability_tab advanced_options show_if_accommodation-booking"><a href="#accommodation_bookings_availability"><span><?php _e( 'Availability', 'woocommerce-accommodation-bookings' ); ?></span></a></li>2 <li class="accommodation_bookings_tab accommodation_bookings_pricing_tab bookings_pricing_tab advanced_options show_if_accommodation-booking"><a href="#accommodation_bookings_rates"><span><?php _e( 'Rates', 'woocommerce-accommodation-bookings' ); ?></span></a></li>1 <li class="accommodation_bookings_tab accommodation_bookings_availability_tab bookings_availability_tab advanced_options show_if_accommodation-booking"><a href="#accommodation_bookings_availability"><span><?php esc_html_e( 'Availability', 'woocommerce-accommodation-bookings' ); ?></span></a></li> 2 <li class="accommodation_bookings_tab accommodation_bookings_pricing_tab bookings_pricing_tab advanced_options show_if_accommodation-booking"><a href="#accommodation_bookings_rates"><span><?php esc_html_e( 'Rates', 'woocommerce-accommodation-bookings' ); ?></span></a></li> -
woocommerce-accommodation-bookings/tags/1.1.41/languages/woocommerce-accommodation-bookings.pot
r2911748 r2917865 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WooCommerce Accommodation Bookings 1.1.4 0\n"5 "Project-Id-Version: WooCommerce Accommodation Bookings 1.1.41\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-accommodation-bookings\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2023-05- 12T17:52:26+00:00\n"12 "POT-Creation-Date: 2023-05-26T15:12:20+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.7.1\n" … … 35 35 msgstr "" 36 36 37 #: includes/admin/class-wc-accommodation-booking-admin-panels.php:32 37 #: includes/admin/class-wc-accommodation-booking-admin-panels.php:39 38 #: includes/class-wc-accommodation-booking.php:206 39 msgid "night" 40 msgid_plural "nights" 41 msgstr[0] "" 42 msgstr[1] "" 43 44 #: includes/admin/class-wc-accommodation-booking-admin-panels.php:49 38 45 msgid "Accommodation product" 39 46 msgstr "" … … 415 422 msgstr "" 416 423 417 #: includes/class-wc-accommodation-booking.php:206418 msgid "night"419 msgstr ""420 421 424 #: includes/class-wc-accommodation-bookings-plugin.php:258 422 425 msgid "View Documentation" -
woocommerce-accommodation-bookings/tags/1.1.41/readme.txt
r2911748 r2917865 4 4 Requires at least: 5.6 5 5 Tested up to: 6.1 6 Stable tag: 1.1.4 06 Stable tag: 1.1.41 7 7 License: GNU General Public License v3.0 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 36 36 37 37 == Changelog == 38 39 = 1.1.41 - 2023-05-26 = 40 * Dev - Add product unit filter, `wc_bookings_product_duration_fallback`, to add night unit support. 41 * Dev - Fix linting errors found by the Quality Insights Toolkit. 38 42 39 43 = 1.1.40 - 2023-05-12 = -
woocommerce-accommodation-bookings/tags/1.1.41/woocommerce-accommodation-bookings.php
r2911748 r2917865 4 4 * Plugin URI: https://woocommerce.com/products/woocommerce-accommodation-bookings/ 5 5 * Description: An accommodations add-on for the WooCommerce Bookings extension. 6 * Version: 1.1.4 06 * Version: 1.1.41 7 7 * Author: WooCommerce 8 8 * Author URI: https://woocommerce.com … … 24 24 } 25 25 26 define( 'WC_ACCOMMODATION_BOOKINGS_VERSION', '1.1.4 0' ); // WRCS: DEFINED_VERSION.26 define( 'WC_ACCOMMODATION_BOOKINGS_VERSION', '1.1.41' ); // WRCS: DEFINED_VERSION. 27 27 28 28 require_once( 'includes/class-wc-accommodation-bookings-plugin.php' ); -
woocommerce-accommodation-bookings/trunk/changelog.txt
r2911748 r2917865 1 1 *** Changelog *** 2 3 = 1.1.41 - 2023-05-26 = 4 * Dev - Add product unit filter, `wc_bookings_product_duration_fallback`, to add night unit support. 5 * Dev - Fix linting errors found by the Quality Insights Toolkit. 2 6 3 7 = 1.1.40 - 2023-05-12 = -
woocommerce-accommodation-bookings/trunk/includes/admin/class-wc-accommodation-booking-admin-panels.php
r2815380 r2917865 15 15 add_filter( 'product_type_selector', array( $this, 'product_type_selector' ) ); 16 16 add_filter( 'product_type_options', array( $this, 'product_type_options' ), 15 ); 17 add_filter( 'wc_bookings_product_duration_fallback', array( $this, 'get_product_duration' ), 10, 3 ); 17 18 18 19 add_action( 'woocommerce_product_data_panels', array( $this, 'panels' ) ); … … 23 24 24 25 add_action( 'woocommerce_process_product_meta', array( $this,'save_product_data' ), 25 ); 26 } 27 28 /** 29 * Filters product unit to display. 30 * 31 * @param string $duration_unit_default Default fallback duration 32 * @param string $duration_unit Current duration unit 33 * @param int $duration Duration of booking 34 * 35 * @return string 36 */ 37 public function get_product_duration( $duration_unit_default, $duration_unit, $duration ) { 38 if ( 'night' === $duration_unit ) { 39 return _n( 'night', 'nights', $duration, 'woocommerce-accommodation-bookings' ); 40 } 41 return $duration_unit_default; 25 42 } 26 43 … … 154 171 155 172 foreach ( $meta_to_save as $meta_key => $sanitize ) { 156 $value = ! empty( $_POST[ $meta_key ] ) ? $_POST[ $meta_key ] : '';173 $value = sanitize_text_field( wp_unslash( $_POST[ $meta_key ] ?? '' ) ); 157 174 switch ( $sanitize ) { 158 175 case 'int' : … … 174 191 } 175 192 break; 176 default :177 $value = sanitize_text_field( $value );178 193 } 179 194 … … 202 217 $availability[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_from_date' ][ $i ] ); 203 218 $availability[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_to_date' ][ $i ] ); 204 break;219 break; 205 220 case 'months' : 206 221 $availability[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_from_month' ][ $i ] ); 207 222 $availability[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_to_month' ][ $i ] ); 208 break;223 break; 209 224 case 'weeks' : 210 225 $availability[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_from_week' ][ $i ] ); 211 226 $availability[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_to_week' ][ $i ] ); 212 break;227 break; 213 228 case 'days' : 214 229 $availability[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_from_day_of_week' ][ $i ] ); 215 230 $availability[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_availability_to_day_of_week' ][ $i ] ); 216 break;231 break; 217 232 } 218 233 } … … 226 241 // Resources 227 242 if ( isset( $_POST['resource_id'] ) && isset( $_POST['_wc_booking_has_resources'] ) ) { 228 $resource_ids = $_POST['resource_id']; 229 $resource_menu_order = $_POST['resource_menu_order']; 230 $resource_base_cost = $_POST['resource_cost']; 231 $resource_block_cost = $_POST['resource_block_cost']; 232 $max_loop = max( array_keys( $_POST['resource_id'] ) ); 243 $resource_data = filter_input_array( 244 INPUT_POST, 245 array( 246 'resource_id' => array( 247 'filter' => FILTER_VALIDATE_INT, 248 'flags' => FILTER_REQUIRE_ARRAY, 249 ), 250 'resource_menu_order' => array( 251 'filter' => FILTER_VALIDATE_INT, 252 'flags' => FILTER_REQUIRE_ARRAY, 253 ), 254 'resource_cost' => array( 255 'filter' => FILTER_VALIDATE_FLOAT, 256 'flags' => FILTER_REQUIRE_ARRAY, 257 ), 258 'resource_block_cost' => array( 259 'filter' => FILTER_VALIDATE_FLOAT, 260 'flags' => FILTER_REQUIRE_ARRAY, 261 ), 262 ) 263 ); 264 $resource_ids = $resource_data['resource_id']; 265 $resource_menu_order = $resource_data['resource_menu_order']; 266 $resource_base_cost = $resource_data['resource_cost']; 267 $resource_block_cost = $resource_data['resource_block_cost']; 268 269 $max_loop = max( array_keys( $resource_ids ) ); 270 233 271 $resource_base_costs = array(); 234 272 $resource_block_costs = array(); … … 244 282 "{$wpdb->prefix}wc_booking_relationships", 245 283 array( 246 'sort_order' => $resource_menu_order[ $i ]284 'sort_order' => absint( $resource_menu_order[ $i ] ), 247 285 ), 248 286 array( 249 287 'product_id' => $post_id, 250 'resource_id' => $resource_id 288 'resource_id' => $resource_id, 251 289 ) 252 290 ); … … 263 301 update_post_meta( $post_id, '_resource_block_costs', $resource_block_costs ); 264 302 } 265 303 266 304 // Rates 267 305 $pricing = array(); … … 280 318 $pricing[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_from_date' ][ $i ] ); 281 319 $pricing[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_to_date' ][ $i ] ); 282 break;320 break; 283 321 case 'months' : 284 322 $pricing[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_from_month' ][ $i ] ); 285 323 $pricing[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_to_month' ][ $i ] ); 286 break;324 break; 287 325 case 'weeks' : 288 326 $pricing[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_from_week' ][ $i ] ); 289 327 $pricing[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_to_week' ][ $i ] ); 290 break;328 break; 291 329 case 'days' : 292 330 $pricing[ $i ]['from'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_from_day_of_week' ][ $i ] ); 293 331 $pricing[ $i ]['to'] = wc_clean( $_POST[ 'wc_accommodation_booking_pricing_to_day_of_week' ][ $i ] ); 294 break;295 } 296 } 297 332 break; 333 } 334 } 335 298 336 // Person Types 299 337 if ( isset( $_POST['person_id'] ) && isset( $_POST['_wc_booking_has_persons'] ) ) { 300 $person_ids = $_POST['person_id']; 301 $person_menu_order = $_POST['person_menu_order']; 302 $person_name = $_POST['person_name']; 303 $person_cost = $_POST['person_cost']; 304 $person_block_cost = $_POST['person_block_cost']; 305 $person_description = $_POST['person_description']; 306 $person_min = $_POST['person_min']; 307 $person_max = $_POST['person_max']; 308 309 $max_loop = max( array_keys( $_POST['person_id'] ) ); 338 $person_data = filter_input_array( 339 INPUT_POST, 340 array( 341 'person_id' => array( 342 'filter' => FILTER_VALIDATE_INT, 343 'flags' => FILTER_REQUIRE_ARRAY, 344 ), 345 'person_menu_order' => array( 346 'filter' => FILTER_VALIDATE_INT, 347 'flags' => FILTER_REQUIRE_ARRAY, 348 ), 349 'person_name' => array( 350 'filter' => FILTER_DEFAULT, 351 'flags' => FILTER_REQUIRE_ARRAY, 352 ), 353 'person_cost' => array( 354 'filter' => FILTER_VALIDATE_FLOAT, 355 'flags' => FILTER_REQUIRE_ARRAY, 356 ), 357 'person_block_cost' => array( 358 'filter' => FILTER_VALIDATE_FLOAT, 359 'flags' => FILTER_REQUIRE_ARRAY, 360 ), 361 'person_description' => array( 362 'filter' => FILTER_DEFAULT, 363 'flags' => FILTER_REQUIRE_ARRAY, 364 ), 365 'person_min' => array( 366 'filter' => FILTER_VALIDATE_INT, 367 'flags' => FILTER_REQUIRE_ARRAY, 368 ), 369 'person_max' => array( 370 'filter' => FILTER_VALIDATE_INT, 371 'flags' => FILTER_REQUIRE_ARRAY, 372 ), 373 ) 374 ); 375 $person_ids = $person_data['person_id']; 376 $person_menu_order = $person_data['person_menu_order']; 377 $person_name = $person_data['person_name']; 378 $person_cost = $person_data['person_cost']; 379 $person_block_cost = $person_data['person_block_cost']; 380 $person_description = $person_data['person_description']; 381 $person_min = $person_data['person_min']; 382 $person_max = $person_data['person_max']; 383 384 $max_loop = max( array_keys( $person_ids ) ); 310 385 311 386 for ( $i = 0; $i <= $max_loop; $i ++ ) { … … 320 395 } 321 396 322 $wpdb->update( 323 $wpdb->posts, 397 wp_update_post( 324 398 array( 399 'ID' => $person_id, 325 400 'post_title' => stripslashes( $person_name[ $i ] ), 326 401 'post_excerpt' => stripslashes( $person_description[ $i ] ), 327 'menu_order' => $person_menu_order[ $i ] ), 328 array( 329 'ID' => $person_id 330 ), 331 array( 332 '%s', 333 '%s', 334 '%d' 335 ), 336 array( '%d' ) 402 'menu_order' => $person_menu_order[ $i ], 403 ) 337 404 ); 338 405 -
woocommerce-accommodation-bookings/trunk/includes/admin/class-wc-accommodation-booking-admin-product-settings.php
r2736571 r2917865 219 219 <label for="<?php echo esc_attr( $field_key ); ?>"><?php echo esc_html( $value['title'] ); ?></label> 220 220 </th> 221 <td class="forminp forminp-<?php echo sanitize_title( $value['type']) ?>">221 <td class="forminp forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ) ?>"> 222 222 <input 223 223 name="<?php echo esc_attr( $field_key ); ?>" -
woocommerce-accommodation-bookings/trunk/includes/admin/views/html-accommodation-booking-availability-fields.php
r1322513 r2917865 44 44 <div class="select wc_booking_availability_type"> 45 45 <select name="wc_accommodation_booking_availability_type[]"> 46 <option value="custom" <?php selected( $availability['type'], 'custom' ); ?>><?php _e( 'Custom date range', 'woocommerce-accommodation-bookings' ); ?></option>47 <option value="months" <?php selected( $availability['type'], 'months' ); ?>><?php _e( 'Range of months', 'woocommerce-accommodation-bookings' ); ?></option>48 <option value="weeks" <?php selected( $availability['type'], 'weeks' ); ?>><?php _e( 'Range of weeks', 'woocommerce-accommodation-bookings' ); ?></option>49 <option value="days" <?php selected( $availability['type'], 'days' ); ?>><?php _e( 'Range of days', 'woocommerce-accommodation-bookings' ); ?></option>46 <option value="custom" <?php selected( $availability['type'], 'custom' ); ?>><?php esc_html_e( 'Custom date range', 'woocommerce-accommodation-bookings' ); ?></option> 47 <option value="months" <?php selected( $availability['type'], 'months' ); ?>><?php esc_html_e( 'Range of months', 'woocommerce-accommodation-bookings' ); ?></option> 48 <option value="weeks" <?php selected( $availability['type'], 'weeks' ); ?>><?php esc_html_e( 'Range of weeks', 'woocommerce-accommodation-bookings' ); ?></option> 49 <option value="days" <?php selected( $availability['type'], 'days' ); ?>><?php esc_html_e( 'Range of days', 'woocommerce-accommodation-bookings' ); ?></option> 50 50 </select> 51 51 </div> … … 106 106 <div class="select"> 107 107 <select name="wc_accommodation_booking_availability_bookable[]"> 108 <option value="no" <?php selected( isset( $availability['bookable'] ) && $availability['bookable'] == 'no', true ) ?>><?php _e( 'No', 'woocommerce-accommodation-bookings' ) ;?></option>109 <option value="yes" <?php selected( isset( $availability['bookable'] ) && $availability['bookable'] == 'yes', true ) ?>><?php _e( 'Yes', 'woocommerce-accommodation-bookings' ) ;?></option>108 <option value="no" <?php selected( isset( $availability['bookable'] ) && $availability['bookable'] == 'no', true ) ?>><?php esc_html_e( 'No', 'woocommerce-accommodation-bookings' ) ;?></option> 109 <option value="yes" <?php selected( isset( $availability['bookable'] ) && $availability['bookable'] == 'yes', true ) ?>><?php esc_html_e( 'Yes', 'woocommerce-accommodation-bookings' ) ;?></option> 110 110 </select> 111 111 </div> -
woocommerce-accommodation-bookings/trunk/includes/admin/views/html-accommodation-booking-availability.php
r2621336 r2917865 10 10 ?> 11 11 <p class="form-field"> 12 <label for="_wc_accommodation_booking_min_date"><?php _e( 'Bookings can be made starting', 'woocommerce-accommodation-bookings' ); ?></label>12 <label for="_wc_accommodation_booking_min_date"><?php esc_html_e( 'Bookings can be made starting', 'woocommerce-accommodation-bookings' ); ?></label> 13 13 <input type="number" name="_wc_accommodation_booking_min_date" id="_wc_accommodation_booking_min_date" value="<?php echo esc_attr( $min_date ); ?>" step="1" min="0" style="margin-right: 7px; width: 4em;"> 14 14 <select name="_wc_accommodation_booking_min_date_unit" id="_wc_accommodation_booking_min_date_unit" class="short" style="margin-right: 7px;"> 15 <option value="month" <?php selected( $min_date_unit, 'month' ); ?>><?php _e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option>16 <option value="week" <?php selected( $min_date_unit, 'week' ); ?>><?php _e( 'Week(s)', 'woocommerce-accommodation-bookings' ); ?></option>17 <option value="day" <?php selected( $min_date_unit, 'day' ); ?>><?php _e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option>18 </select> <?php _e( 'into the future', 'woocommerce-accommodation-bookings' ); ?>15 <option value="month" <?php selected( $min_date_unit, 'month' ); ?>><?php esc_html_e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option> 16 <option value="week" <?php selected( $min_date_unit, 'week' ); ?>><?php esc_html_e( 'Week(s)', 'woocommerce-accommodation-bookings' ); ?></option> 17 <option value="day" <?php selected( $min_date_unit, 'day' ); ?>><?php esc_html_e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option> 18 </select> <?php esc_html_e( 'into the future', 'woocommerce-accommodation-bookings' ); ?> 19 19 </p> 20 20 <?php … … 27 27 ?> 28 28 <p class="form-field"> 29 <label for="_wc_accommodation_booking_max_date"><?php _e( 'Bookings can only be made', 'woocommerce-accommodation-bookings' ); ?></label>29 <label for="_wc_accommodation_booking_max_date"><?php esc_html_e( 'Bookings can only be made', 'woocommerce-accommodation-bookings' ); ?></label> 30 30 <input type="number" name="_wc_accommodation_booking_max_date" id="_wc_accommodation_booking_max_date" value="<?php echo esc_attr( $max_date ); ?>" step="1" min="1" style="margin-right: 7px; width: 4em;"> 31 31 <select name="_wc_accommodation_booking_max_date_unit" id="_wc_accommodation_booking_max_date_unit" class="short" style="margin-right: 7px;"> 32 <option value="month" <?php selected( $max_date_unit, 'month' ); ?>><?php _e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option>33 <option value="week" <?php selected( $max_date_unit, 'week' ); ?>><?php _e( 'Week(s)', 'woocommerce-accommodation-bookings' ); ?></option>34 <option value="day" <?php selected( $max_date_unit, 'day' ); ?>><?php _e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option>35 </select> <?php _e( 'into the future', 'woocommerce-accommodation-bookings' ); ?>32 <option value="month" <?php selected( $max_date_unit, 'month' ); ?>><?php esc_html_e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option> 33 <option value="week" <?php selected( $max_date_unit, 'week' ); ?>><?php esc_html_e( 'Week(s)', 'woocommerce-accommodation-bookings' ); ?></option> 34 <option value="day" <?php selected( $max_date_unit, 'day' ); ?>><?php esc_html_e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option> 35 </select> <?php esc_html_e( 'into the future', 'woocommerce-accommodation-bookings' ); ?> 36 36 </p> 37 37 … … 70 70 ); 71 71 72 for ( $i=0; $i < 7; $i++) { 72 for ( $i=0; $i < 7; $i++) { 73 73 ?> 74 74 <td> 75 <label class="checkbox" for="_wc_accommodation_booking_restricted_days[<?php echo $i; ?>]" style="width: auto;"><?php echo $weekdays[ $i ]; ?> </label>76 <input type="checkbox" class="checkbox" name="_wc_accommodation_booking_restricted_days[<?php echo $i; ?>]" id="_wc_accommodation_booking_restricted_days[<?php echo $i; ?>]" value="<?php echo $i; ?>" <?php checked( $restricted_days[ $i ], $i ); ?>>75 <label class="checkbox" for="_wc_accommodation_booking_restricted_days[<?php echo esc_attr( $i ); ?>]" style="width: auto;"><?php echo esc_html( $weekdays[ $i ] ); ?> </label> 76 <input type="checkbox" class="checkbox" name="_wc_accommodation_booking_restricted_days[<?php echo esc_attr( $i ); ?>]" id="_wc_accommodation_booking_restricted_days[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $i ); ?>" <?php checked( $restricted_days[ $i ], $i ); ?>> 77 77 </td> 78 78 <?php -
woocommerce-accommodation-bookings/trunk/includes/admin/views/html-accommodation-booking-data.php
r1768725 r2917865 63 63 ?> 64 64 <p class="form-field accommodation-booking-cancel-limit"> 65 <label for="_wc_accommodation_booking_cancel_limit"><?php _e( 'Cancellation up till', 'woocommerce-accommodation-bookings' ); ?></label>65 <label for="_wc_accommodation_booking_cancel_limit"><?php esc_html_e( 'Cancellation up till', 'woocommerce-accommodation-bookings' ); ?></label> 66 66 <input type="number" name="_wc_accommodation_booking_cancel_limit" id="_wc_accommodation_booking_cancel_limit" value="<?php echo esc_attr( $cancel_limit ); ?>" step="1" min="1" style="margin-right: 7px; width: 4em;"> 67 67 <select name="_wc_accommodation_booking_cancel_limit_unit" id="_wc_accommodation_booking_cancel_limit_unit" class="short" style="width: auto; margin-right: 7px;"> 68 <option value="month" <?php selected( $cancel_limit_unit, 'month' ); ?>><?php _e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option>69 <option value="day" <?php selected( $cancel_limit_unit, 'day' ); ?>><?php _e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option>70 <option value="hour" <?php selected( $cancel_limit_unit, 'hour' ); ?>><?php _e( 'Hour(s)', 'woocommerce-accommodation-bookings' ); ?></option>71 <option value="minute" <?php selected( $cancel_limit_unit, 'minute' ); ?>><?php _e( 'Minute(s)', 'woocommerce-accommodation-bookings' ); ?></option>68 <option value="month" <?php selected( $cancel_limit_unit, 'month' ); ?>><?php esc_html_e( 'Month(s)', 'woocommerce-accommodation-bookings' ); ?></option> 69 <option value="day" <?php selected( $cancel_limit_unit, 'day' ); ?>><?php esc_html_e( 'Day(s)', 'woocommerce-accommodation-bookings' ); ?></option> 70 <option value="hour" <?php selected( $cancel_limit_unit, 'hour' ); ?>><?php esc_html_e( 'Hour(s)', 'woocommerce-accommodation-bookings' ); ?></option> 71 <option value="minute" <?php selected( $cancel_limit_unit, 'minute' ); ?>><?php esc_html_e( 'Minute(s)', 'woocommerce-accommodation-bookings' ); ?></option> 72 72 </select> 73 <span class="description"><?php _e( 'before check-in.', 'woocommerce-accommodation-bookings' ); ?></span>73 <span class="description"><?php esc_html_e( 'before check-in.', 'woocommerce-accommodation-bookings' ); ?></span> 74 74 </p> 75 75 -
woocommerce-accommodation-bookings/trunk/includes/admin/views/html-accommodation-booking-rates-fields.php
r2856041 r2917865 41 41 <div class="select wc_booking_availability_type"> 42 42 <select name="wc_accommodation_booking_pricing_type[]"> 43 <option value="custom" <?php selected( $rate['type'], 'custom' ); ?>><?php _e( 'Range of certain nights', 'woocommerce-accommodation-bookings' ); ?></option>44 <option value="months" <?php selected( $rate['type'], 'months' ); ?>><?php _e( 'Range of months', 'woocommerce-accommodation-bookings' ); ?></option>45 <option value="weeks" <?php selected( $rate['type'], 'weeks' ); ?>><?php _e( 'Range of weeks', 'woocommerce-accommodation-bookings' ); ?></option>46 <option value="days" <?php selected( $rate['type'], 'days' ); ?>><?php _e( 'Range of nights during the week', 'woocommerce-accommodation-bookings' ); ?></option>43 <option value="custom" <?php selected( $rate['type'], 'custom' ); ?>><?php esc_html_e( 'Range of certain nights', 'woocommerce-accommodation-bookings' ); ?></option> 44 <option value="months" <?php selected( $rate['type'], 'months' ); ?>><?php esc_html_e( 'Range of months', 'woocommerce-accommodation-bookings' ); ?></option> 45 <option value="weeks" <?php selected( $rate['type'], 'weeks' ); ?>><?php esc_html_e( 'Range of weeks', 'woocommerce-accommodation-bookings' ); ?></option> 46 <option value="days" <?php selected( $rate['type'], 'days' ); ?>><?php esc_html_e( 'Range of nights during the week', 'woocommerce-accommodation-bookings' ); ?></option> 47 47 </select> 48 48 </div> … … 108 108 // Handle legacy 109 109 if ( ! empty( $rate['override_block'] ) ) { 110 echo $rate['override_block'];110 echo esc_attr( $rate['override_block'] ); 111 111 } else if ( ! empty( $rate['modifier'] ) && isset( $rate['cost'] ) ) { 112 112 $base_cost = abs( floatval( get_post_meta( $post_id, '_wc_booking_base_cost', true ) ) ); 113 113 114 114 if ( 'plus' == $rate['modifier'] ) { 115 echo $base_cost + $rate['cost'];115 echo esc_attr( $base_cost + $rate['cost'] ); 116 116 } else { 117 echo $base_cost - $rate['cost'];117 echo esc_attr( $base_cost - $rate['cost'] ); 118 118 } 119 119 } -
woocommerce-accommodation-bookings/trunk/includes/admin/views/html-accommodation-booking-tabs.php
r1644960 r2917865 1 <li class="accommodation_bookings_tab accommodation_bookings_availability_tab bookings_availability_tab advanced_options show_if_accommodation-booking"><a href="#accommodation_bookings_availability"><span><?php _e( 'Availability', 'woocommerce-accommodation-bookings' ); ?></span></a></li>2 <li class="accommodation_bookings_tab accommodation_bookings_pricing_tab bookings_pricing_tab advanced_options show_if_accommodation-booking"><a href="#accommodation_bookings_rates"><span><?php _e( 'Rates', 'woocommerce-accommodation-bookings' ); ?></span></a></li>1 <li class="accommodation_bookings_tab accommodation_bookings_availability_tab bookings_availability_tab advanced_options show_if_accommodation-booking"><a href="#accommodation_bookings_availability"><span><?php esc_html_e( 'Availability', 'woocommerce-accommodation-bookings' ); ?></span></a></li> 2 <li class="accommodation_bookings_tab accommodation_bookings_pricing_tab bookings_pricing_tab advanced_options show_if_accommodation-booking"><a href="#accommodation_bookings_rates"><span><?php esc_html_e( 'Rates', 'woocommerce-accommodation-bookings' ); ?></span></a></li> -
woocommerce-accommodation-bookings/trunk/languages/woocommerce-accommodation-bookings.pot
r2911748 r2917865 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WooCommerce Accommodation Bookings 1.1.4 0\n"5 "Project-Id-Version: WooCommerce Accommodation Bookings 1.1.41\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-accommodation-bookings\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2023-05- 12T17:52:26+00:00\n"12 "POT-Creation-Date: 2023-05-26T15:12:20+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.7.1\n" … … 35 35 msgstr "" 36 36 37 #: includes/admin/class-wc-accommodation-booking-admin-panels.php:32 37 #: includes/admin/class-wc-accommodation-booking-admin-panels.php:39 38 #: includes/class-wc-accommodation-booking.php:206 39 msgid "night" 40 msgid_plural "nights" 41 msgstr[0] "" 42 msgstr[1] "" 43 44 #: includes/admin/class-wc-accommodation-booking-admin-panels.php:49 38 45 msgid "Accommodation product" 39 46 msgstr "" … … 415 422 msgstr "" 416 423 417 #: includes/class-wc-accommodation-booking.php:206418 msgid "night"419 msgstr ""420 421 424 #: includes/class-wc-accommodation-bookings-plugin.php:258 422 425 msgid "View Documentation" -
woocommerce-accommodation-bookings/trunk/readme.txt
r2911748 r2917865 4 4 Requires at least: 5.6 5 5 Tested up to: 6.1 6 Stable tag: 1.1.4 06 Stable tag: 1.1.41 7 7 License: GNU General Public License v3.0 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 36 36 37 37 == Changelog == 38 39 = 1.1.41 - 2023-05-26 = 40 * Dev - Add product unit filter, `wc_bookings_product_duration_fallback`, to add night unit support. 41 * Dev - Fix linting errors found by the Quality Insights Toolkit. 38 42 39 43 = 1.1.40 - 2023-05-12 = -
woocommerce-accommodation-bookings/trunk/woocommerce-accommodation-bookings.php
r2911748 r2917865 4 4 * Plugin URI: https://woocommerce.com/products/woocommerce-accommodation-bookings/ 5 5 * Description: An accommodations add-on for the WooCommerce Bookings extension. 6 * Version: 1.1.4 06 * Version: 1.1.41 7 7 * Author: WooCommerce 8 8 * Author URI: https://woocommerce.com … … 24 24 } 25 25 26 define( 'WC_ACCOMMODATION_BOOKINGS_VERSION', '1.1.4 0' ); // WRCS: DEFINED_VERSION.26 define( 'WC_ACCOMMODATION_BOOKINGS_VERSION', '1.1.41' ); // WRCS: DEFINED_VERSION. 27 27 28 28 require_once( 'includes/class-wc-accommodation-bookings-plugin.php' );
Note: See TracChangeset
for help on using the changeset viewer.