settings->get(); $ssa_settings = $ssa->settings->remove_unauthorized_settings_for_current_user( $ssa_settings, true, true ); $ssa_appointment_types = $ssa->appointment_type_model->query( array ( 'fetch' => array( 'has_sms' => true, ), ) ); // Clean instruction fields foreach ($ssa_appointment_types as $appointment_type_key => $appointment_type) { if ( empty( $appointment_type['custom_customer_information'] ) ) { continue; } if ( ! is_array( $appointment_type['custom_customer_information'] ) ) { continue; } foreach ($appointment_type['custom_customer_information'] as $field_key => $field) { if ( empty( $ssa_appointment_types[$appointment_type_key]['custom_customer_information'][$field_key]['instructions'] ) ) { continue; } $ssa_appointment_types[$appointment_type_key]['custom_customer_information'][$field_key]['instructions'] = strip_tags( $ssa_appointment_types[$appointment_type_key]['custom_customer_information'][$field_key]['instructions'], '' ); } } // Override availability window foreach ($ssa_appointment_types as $appointment_type_key => $appointment_type) { if ( ! empty( $_GET['availability_start_date'] ) ) { $ssa_appointment_types[$appointment_type_key]['availability_start_date'] = esc_attr( $_GET['availability_start_date'] ); } if ( ! empty( $_GET['availability_end_date'] ) ) { $ssa_appointment_types[$appointment_type_key]['availability_end_date'] = esc_attr( $_GET['availability_end_date'] ); } if ( ! empty( $_GET['suggest_first_available_within_minutes'] ) && $ssa->settings_installed->is_installed( 'booking_flows' ) ) { $ssa_appointment_types[$appointment_type_key]['booking_flow_settings']['suggest_first_available_within_minutes'] = (int) esc_attr( $_GET['suggest_first_available_within_minutes'] ); } if ( ! empty( $_GET['flow'] ) && $ssa->settings_installed->is_installed( 'booking_flows' ) ) { $flow = sanitize_key($_GET['flow']); $ssa_appointment_types[$appointment_type_key]['booking_flow_settings']['booking_flow'] = $flow; if ($flow != 'first_available' ) { $ssa_appointment_types[$appointment_type_key]['booking_flow_settings']['suggest_first_available'] = false; } else { $ssa_appointment_types[$appointment_type_key]['booking_flow_settings']['suggest_first_available'] = true; } } if ( ! empty( $_GET['fallback_flow'] ) && $ssa->settings_installed->is_installed( 'booking_flows' ) ) { $ssa_appointment_types[$appointment_type_key]['booking_flow_settings']['fallback_booking_flow'] = esc_attr( $_GET['fallback_flow'] ); } if ( ! empty( $_GET['date_view'] ) ) { $date_view = esc_attr( $_GET['date_view']); if( $ssa->settings_installed->is_installed( 'booking_flows' ) ) { $ssa_appointment_types[$appointment_type_key]['booking_layout'] = $date_view; } elseif ( $date_view === "month" || $date_view === "week" ){ $ssa_appointment_types[$appointment_type_key]['booking_layout'] = $date_view; } } if ( ! empty( $_GET['time_view'] ) && $ssa->settings_installed->is_installed( 'booking_flows' ) ) { $ssa_appointment_types[$appointment_type_key]['booking_flow_settings']['time_view'] = esc_attr( $_GET['time_view'] ); } } // Check for $_GET['label'] if set, and convert it to $_GET['types'] if( ! empty( $_GET['label'] ) ) { $label = sanitize_text_field( esc_attr( $_GET['label'] ) ); $ids = $ssa->shortcodes->convert_label_to_appt_types_ids( $label ); if ( empty( $ids ) ) { $error_message = '

' . __('Sorry, no appointment types available for this label, please check back later.', 'simply-schedule-appointments') . '

'; if( current_user_can( 'ssa_manage_site_settings' ) ) { $error_message .= '' . sprintf( __('The specified appointment type label \'%1$s\' can\'t be found, or has no appointment types available %2$s (this message only viewable to site administrators)', 'simply-schedule-appointments'), $label, '' ); } return $error_message; } else { $_GET['types'] = $ids; } } if ( ! empty( $_GET['types'] ) ) { $params_types = esc_attr( $_GET['types'] ); } else if ( ! empty( $params['types'] ) ) { $params_types = $params['types']; } if ( ! empty( $params_types ) ) { $restricted_types = explode( ',', $params_types ); $ssa_appointment_types = array_filter( $ssa_appointment_types, function( $appointment_type ) use ( $restricted_types ) { if ( empty( $appointment_type['id'] ) || empty( $appointment_type['slug'] ) ) { return false; } if ( in_array( $appointment_type['id'], $restricted_types ) ) { return true; } if ( in_array( $appointment_type['slug'], $restricted_types ) ) { return true; } return false; }); $ssa_appointment_types = array_values( $ssa_appointment_types ); } $ssa_appointment_types = apply_filters( 'ssa_booking_appointment_types', $ssa_appointment_types ); // Setup booking URL parameters for global variable $ssa_booking_url_settings = array( 'booking_url' => null, 'booking_post_id' => null, 'booking_title' => null, ); if( isset( $_GET['booking_url'] ) ) { $ssa_booking_url_settings['booking_url'] = esc_attr( $_GET['booking_url'] ); } if( isset( $_GET['booking_post_id'] ) ) { $ssa_booking_url_settings['booking_post_id'] = esc_attr( $_GET['booking_post_id'] ); } if( isset( $_GET['booking_title'] ) ) { $ssa_booking_url_settings['booking_title'] = html_entity_decode( urldecode( esc_attr( $_GET['booking_title'] ) ) ); } function ssa_get_language_attributes( $doctype = 'html' ) { $attributes = array(); $is_rtl = SSA_Translation::is_rtl(); $lang = SSA_Translation::get_locale(); $lang = str_replace( '_', '-', $lang ); if ( $is_rtl ) { $attributes[] = 'dir="rtl"'; } $attributes[] = 'lang="' . esc_attr( $lang ) . '"'; $output = implode( ' ', $attributes ); return $output; } ?> > <?php the_title(); ?> ' /> templates->locate_template_url( 'booking-app/custom.css' ); ?> templates->locate_template('booking-app/custom.css'); ?> styles_settings->get(); // if we have style settings on the GET parameters, merge them with the styles settings $styles_params = array(); // accent_color possible value patterns: ffffff or rgba(255,255,255,1) if( isset( $_GET['accent_color'] ) && ! empty( $_GET['accent_color'] ) ) { $accent_color = ssa_sanitize_color_input( $_GET['accent_color'] ); $accent_color = $ssa->styles->hex_to_rgba( '#' . $accent_color ); if( $accent_color ) { $styles_params['accent_color'] = $accent_color; } } // background possible value patterns: ffffff or rgba(255,255,255,1) if( isset( $_GET['background'] ) && ! empty( $_GET['background'] ) ) { $background = ssa_sanitize_color_input( $_GET['background'] ); $background = $ssa->styles->hex_to_rgba( '#' . $background ); if( $background ) { $styles_params['background'] = $background; } } if( isset( $_GET['font'] ) && ! empty( $_GET['font'] ) ) { $styles_params['font'] = esc_attr( $_GET['font'] ); } if( isset( $_GET['padding'] ) && ! empty( $_GET['padding'] ) ) { $styles_params['padding'] = esc_attr( $_GET['padding'] ); } $ssa_styles = wp_parse_args( $styles_params, $ssa_styles ); /* Use luminosity contrast of iframe background color to determine if the headings text color should be black or white */ $iframe_bg_contrast_ratio = $ssa->styles->get_contrast_ratio( $ssa_styles['background'] ); $iframe_bg_transparency = $ssa->styles->get_transparency( $ssa_styles['background'] ); /* Use luminosity contrast of accent color to determine if the accent color - book-day & time-select elements - should have black or white text */ $contrast_ratio = $ssa->styles->get_contrast_ratio( $ssa_styles['accent_color'] ); // Set accent contrast based on luminosity of the color if ($contrast_ratio > 6 ) { $ssa_styles['accent_contrast'] = 'black'; } else { $ssa_styles['accent_contrast'] = 'white'; } $is_dark = $ssa->styles->is_dark_background( $ssa_styles['background'] ); // Separate padding value into integer and units $padding_atts = $ssa->styles->get_style_atts_from_string( $ssa_styles['padding'] ); // Attach Google stylesheet if necessary $system_fonts = array( 'Arial' => 'Arial, Helvetica Neue, Helvetica, sans-serif', 'Arial Black' => 'Arial Black, Arial Bold, Gadget, sans-serif', 'Courier New' => 'Courier New, Courier, Lucida Sans Typewriter, Lucida Typewriter, monospace', 'Georgia' => 'Georgia, Times, Times New Roman, serif', 'Helvetica' => 'Helvetica Neue, Helvetica, Arial, sans-serif', 'Tahoma' => 'Tahoma, Verdana, Segoe, sans-serif', 'Times New Roman' => 'TimesNewRoman, Times New Roman, Times, Baskerville, Georgia,serif', 'Trebuchet MS' => 'Trebuchet MS, Lucida Grande, Lucida Sans Unicode, Lucida Sans, Tahoma, sans-serif', 'Verdana' => 'Verdana, Geneva, sans-serif', 'Roboto' => 'Roboto' ); $is_system_font = in_array(trim($ssa_styles['font']), $system_fonts); if ( !$is_system_font ) : ?> queue as $handle_key => $handle) { if ( $handle === 'ssa-custom' ) { continue; } wp_dequeue_style( $handle ); } wp_print_styles(); } // END: Deprecated ?> data-iframe-height>
'; ?> settings_installed->is_activated( 'stripe' ) ): ?>