PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 All 204 releases
← All changes | includes/page-form-builder/form-render/bfb-form-render.php +9 -12 11.011.8.4 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * Universal Booking Form shortcode renderer.
4 4 *
@@ -110,21 +110,18 @@
110 110 // -----------------------------------------------------------------------------------------------------------------
111 111 $admin_uri = ltrim( str_replace( get_site_url( null, '', 'admin' ), '', admin_url( 'admin.php?' ) ), '/' ); // FixIn: 8.8.1.2.
112 112
113 113 $server_request_uri = ( ( isset( $_SERVER['REQUEST_URI'] ) ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '' );
114 + $is_add_booking_admin_context = ( function_exists( 'wpbc_is_new_booking_page_url' ) && wpbc_is_new_booking_page_url( $server_request_uri ) );
114 115
115 - if ( strpos( $server_request_uri, $admin_uri ) === false ) { // Only in front-end side.
116 - if ( false !== $req['current_edit_booking_id'] ) {
117 - foreach ( $engine->current_edit_booking['dates'] as $b_date ) {
118 - if ( wpbc_is_date_in_past( $b_date ) ) {
119 - $html = '<div class="wpdevelop"><div class="alert alert-warning alert-danger">' .
120 - __( 'The booked dates already in the past', 'booking' ) .
121 - '</div></div>' .
122 - '<script type="text/javascript">setTimeout( function(){ jQuery( ".hasDatepick" ).hide(); }, 500 );</script>';
123 - }
124 - }
125 - }
126 - }
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 + }
127 124
128 125 $html = apply_filters( 'wpbc_replace_shortcodes_in_booking_form', $html, $engine->current_resource_id, $req['form_slug'] ); // FixIn: 9.4.3.6.
129 126
130 127 // Info: Hook for addons. Filter parsed HTML right after shortcode parsing, but before legacy filters like wpbc_update_bookingform_content__after_load.