| @@ -52,11 +52,12 @@ | ||
| 52 | 52 | 'start_month_calendar' => false, |
| 53 | 53 | 'shortcode_param__options' => '', |
| 54 | 54 | 'calendar_dates_start' => '', |
| 55 | 55 | 'calendar_dates_end' => '', |
| 56 | - 'booking_hash' => '', | |
| 57 | - 'form_status' => 'published', | |
| 58 | - 'calendar_request_overrides' => array(), | |
| 56 | + 'booking_hash' => '', | |
| 57 | + 'form_status' => 'published', | |
| 58 | + 'booking_workflow' => 'classic', | |
| 59 | + 'calendar_request_overrides' => array(), | |
| 59 | 60 | ); |
| 60 | 61 | $params_arr = wp_parse_args( $params_arr, $default_params ); |
| 61 | 62 | $is_echo = ( ! empty( $params_arr['is_echo'] ) ); |
| 62 | 63 | |
| @@ -123,9 +124,22 @@ | ||
| 123 | 124 | |
| 124 | 125 | // --------------------------------------------------------------------- |
| 125 | 126 | // Normalize calendar_dates_start/end. |
| 126 | 127 | // --------------------------------------------------------------------- |
| 127 | - $calendar_dates_range = WPBC_FE_Attr_Postprocessor::normalize_calendar_dates_range( $params_arr['calendar_dates_start'], $params_arr['calendar_dates_end'] ); | |
| 128 | + $calendar_dates_range = WPBC_FE_Attr_Postprocessor::normalize_calendar_dates_range( $params_arr['calendar_dates_start'], $params_arr['calendar_dates_end'] ); | |
| 129 | + $classic_booking_context_token = ''; | |
| 130 | + if ( function_exists( 'wpbc_classic_booking_context_encode' ) ) { | |
| 131 | + $classic_booking_context_token = wpbc_classic_booking_context_encode( | |
| 132 | + array( | |
| 133 | + 'booking_workflow' => $params_arr['booking_workflow'], | |
| 134 | + 'resource_id' => $params_arr['resource_id'], | |
| 135 | + 'calendar_dates_start' => $calendar_dates_range['start'], | |
| 136 | + 'calendar_dates_end' => $calendar_dates_range['end'], | |
| 137 | + 'custom_form' => $params_arr['custom_booking_form'], | |
| 138 | + 'aggregate_resource_ids' => $aggregate_resource_id_arr, | |
| 139 | + ) | |
| 140 | + ); | |
| 141 | + } | |
| 128 | 142 | |
| 129 | 143 | // --------------------------------------------------------------------- |
| 130 | 144 | // Calendar load params (keep identical keys). |
| 131 | 145 | // --------------------------------------------------------------------- |
| @@ -136,11 +150,12 @@ | ||
| 136 | 150 | 'calendar_number_of_months' => $params_arr['cal_count'], |
| 137 | 151 | 'start_month_calendar' => $params_arr['start_month_calendar'], |
| 138 | 152 | 'shortcode_options' => $params_arr['shortcode_param__options'], |
| 139 | 153 | 'custom_form' => $params_arr['custom_booking_form'], |
| 140 | - 'calendar_dates_start' => $calendar_dates_range['start'], | |
| 141 | - 'calendar_dates_end' => $calendar_dates_range['end'], | |
| 142 | - 'calendar_request_overrides' => $params_arr['calendar_request_overrides'], | |
| 154 | + 'calendar_dates_start' => $calendar_dates_range['start'], | |
| 155 | + 'calendar_dates_end' => $calendar_dates_range['end'], | |
| 156 | + 'classic_booking_context_token' => $classic_booking_context_token, | |
| 157 | + 'calendar_request_overrides' => $params_arr['calendar_request_overrides'], | |
| 143 | 158 | ); |
| 144 | 159 | |
| 145 | 160 | $start_script_code = wpbc__calendar__load( $calendar_load_params ); |
| 146 | 161 | |