← All changes
|
includes/page-form-builder/form-render/bfb-form-render.php
+8
-12
11.1
→
11.8.4
View file →
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Universal Booking Form shortcode renderer. |
| 4 | 4 | * |
| @@ -112,20 +112,16 @@ | ||
| 112 | 112 | |
| 113 | 113 | $server_request_uri = ( ( isset( $_SERVER['REQUEST_URI'] ) ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '' ); |
| 114 | 114 | $is_add_booking_admin_context = ( function_exists( 'wpbc_is_new_booking_page_url' ) && wpbc_is_new_booking_page_url( $server_request_uri ) ); |
| 115 | 115 | |
| 116 | - if ( ( strpos( $server_request_uri, $admin_uri ) === false ) && ! $is_add_booking_admin_context ) { // Only in front-end side. | |
| 117 | - if ( false !== $req['current_edit_booking_id'] ) { | |
| 118 | - foreach ( $engine->current_edit_booking['dates'] as $b_date ) { | |
| 119 | - if ( wpbc_is_date_in_past( $b_date ) ) { | |
| 120 | - $html = '<div class="wpdevelop"><div class="alert alert-warning alert-danger">' . | |
| 121 | - __( 'The booked dates already in the past', 'booking' ) . | |
| 122 | - '</div></div>' . | |
| 123 | - '<script type="text/javascript">setTimeout( function(){ jQuery( ".hasDatepick" ).hide(); }, 500 );</script>'; | |
| 124 | - } | |
| 125 | - } | |
| 126 | - } | |
| 127 | - } | |
| 116 | + if ( ( strpos( $server_request_uri, $admin_uri ) === false ) && ! $is_add_booking_admin_context ) { // Only in front-end side. | |
| 117 | + if ( ( false !== $req['current_edit_booking_id'] ) && ! wpbc_is_visitor_booking_action_allowed( $req['current_edit_booking_id'] ) ) { | |
| 118 | + $html = '<div class="wpdevelop"><div class="alert alert-warning alert-danger">' . | |
| 119 | + __( 'The booked dates already in the past', 'booking' ) . | |
| 120 | + '</div></div>' . | |
| 121 | + '<script type="text/javascript">setTimeout( function(){ jQuery( ".hasDatepick" ).hide(); }, 500 );</script>'; | |
| 122 | + } | |
| 123 | + } | |
| 128 | 124 | |
| 129 | 125 | $html = apply_filters( 'wpbc_replace_shortcodes_in_booking_form', $html, $engine->current_resource_id, $req['form_slug'] ); // FixIn: 9.4.3.6. |
| 130 | 126 | |
| 131 | 127 | // Info: Hook for addons. Filter parsed HTML right after shortcode parsing, but before legacy filters like wpbc_update_bookingform_content__after_load. |