'length',
'key' => 'booking_form_layout_width',
'scope' => 'form',
'default' => '100%', // Applied from JS too; this is a fallback.
'label' => __( 'Form width', 'booking' ),
'help' => __( 'Set the width of the booking form container.', 'booking' ),
'attr' => array(
'id' => 'booking_form_layout_width',
),
'length' => array(
'default_unit' => '%',
'units' => array(
'%' => '%',
'px' => 'px',
'rem' => 'rem',
'em' => 'em',
),
'bounds_map' => array(
'%' => array( 'min' => 30, 'max' => 100, 'step' => 1 ),
'px' => array( 'min' => 300, 'max' => 2000, 'step' => 10 ),
'rem' => array( 'min' => 10, 'max' => 200, 'step' => 0.5 ),
'em' => array( 'min' => 10, 'max' => 200, 'step' => 0.5 ),
),
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'toggle',
'key' => 'booking_form_accent_enabled',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => $wpbc_bfb_accent_values['booking_form_accent_enabled'],
'label' => __( 'Custom accent color', 'booking' ),
'help' => __( 'Use one accent for preset-style primary buttons, secondary-button hover borders, focused fields, selected choices, and navigation accents. Custom style keeps its explicitly configured button colors. Time slots use the accent only with the Automatic time-slot style.', 'booking' ),
'attr' => array(
'id' => 'booking_form_accent_enabled',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_accent_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => $wpbc_bfb_accent_values['booking_form_accent_color'],
'label' => __( 'Accent color', 'booking' ),
'help' => __( 'Choose the shared interactive color. Preset styles calculate readable primary button text and hover colors automatically; Custom style uses its explicit button settings.', 'booking' ),
'attr' => array(
'id' => 'booking_form_accent_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_accent_color wpbc_bfb__form_setting_global_accent_dependent',
'row_hidden' => ( 'On' !== $wpbc_bfb_accent_values['booking_form_accent_enabled'] ),
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
?>
Theme.
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'radio',
'key' => 'booking_form_style',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => $wpbc_bfb_current_form_style,
'label' => __( 'Form style', 'booking' ),
'help' => __( 'Choose the global form style used by all booking forms.', 'booking' ),
'attr' => array(
'id' => 'booking_form_style',
),
'radio_layout' => 'choice_grid',
'options' => function_exists( 'wpbc_bfb_settings__get_form_style_options' ) ? wpbc_bfb_settings__get_form_style_options() : array(
'light_bordered' => __( 'Light bordered', 'booking' ),
'custom' => __( 'Custom', 'booking' ),
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_background_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_background_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_background_color'] : '#ffffff',
'label' => __( 'Background color', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_background_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_border_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_border_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_border_color'] : '#cccccc',
'label' => __( 'Border color', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_border_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'length',
'key' => 'booking_form_custom_border_width',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_border_width'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_border_width'] : '1px',
'label' => __( 'Border width', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_border_width',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'length' => array(
'default_unit' => 'px',
'units' => array(
'px' => 'px',
'rem' => 'rem',
'em' => 'em',
),
'bounds_map' => array(
'px' => array( 'min' => 0, 'max' => 20, 'step' => 1 ),
'rem' => array( 'min' => 0, 'max' => 5, 'step' => 0.1 ),
'em' => array( 'min' => 0, 'max' => 5, 'step' => 0.1 ),
),
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'length',
'key' => 'booking_form_custom_border_radius',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_border_radius'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_border_radius'] : '2px',
'label' => __( 'Corner radius', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_border_radius',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'length' => array(
'default_unit' => 'px',
'units' => array(
'px' => 'px',
'rem' => 'rem',
'em' => 'em',
),
'bounds_map' => array(
'px' => array( 'min' => 0, 'max' => 40, 'step' => 1 ),
'rem' => array( 'min' => 0, 'max' => 5, 'step' => 0.1 ),
'em' => array( 'min' => 0, 'max' => 5, 'step' => 0.1 ),
),
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'length',
'key' => 'booking_form_custom_padding_vertical',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_padding_vertical'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_padding_vertical'] : '10px',
'label' => __( 'Inner spacing top / bottom', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_padding_vertical',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'length' => array(
'default_unit' => 'px',
'units' => array(
'px' => 'px',
'rem' => 'rem',
'em' => 'em',
),
'bounds_map' => array(
'px' => array( 'min' => 0, 'max' => 120, 'step' => 1 ),
'rem' => array( 'min' => 0, 'max' => 10, 'step' => 0.1 ),
'em' => array( 'min' => 0, 'max' => 10, 'step' => 0.1 ),
),
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'length',
'key' => 'booking_form_custom_padding_horizontal',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_padding_horizontal'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_padding_horizontal'] : '30px',
'label' => __( 'Inner spacing left / right', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_padding_horizontal',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'length' => array(
'default_unit' => 'px',
'units' => array(
'px' => 'px',
'rem' => 'rem',
'em' => 'em',
),
'bounds_map' => array(
'px' => array( 'min' => 0, 'max' => 120, 'step' => 1 ),
'rem' => array( 'min' => 0, 'max' => 10, 'step' => 0.1 ),
'em' => array( 'min' => 0, 'max' => 10, 'step' => 0.1 ),
),
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_text_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_text_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_text_color'] : '#1d2327',
'label' => __( 'Text color', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_text_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_field_background_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_field_background_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_field_background_color'] : '#ffffff',
'label' => __( 'Field background', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_field_background_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_field_text_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_field_text_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_field_text_color'] : '#3c434a',
'label' => __( 'Field text color', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_field_text_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_field_border_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_field_border_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_field_border_color'] : '#cccccc',
'label' => __( 'Field border color', 'booking' ),
'help' => __( 'Used when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_field_border_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_button_background_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_button_background_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_button_background_color'] : '#066aab',
'label' => __( 'Primary button background', 'booking' ),
'help' => __( 'Used by submit and primary buttons when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_button_background_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_button_text_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_button_text_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_button_text_color'] : '#ffffff',
'label' => __( 'Primary button text', 'booking' ),
'help' => __( 'Used by submit and primary buttons when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_button_text_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_button_border_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_button_border_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_button_border_color'] : '#066aab',
'label' => __( 'Primary button border', 'booking' ),
'help' => __( 'Used by submit and primary buttons when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_button_border_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_button_hover_background_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_button_hover_background_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_button_hover_background_color'] : '#055589',
'label' => __( 'Primary hover background', 'booking' ),
'help' => __( 'Used when a submit or primary button is hovered, focused, or active.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_button_hover_background_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_button_hover_text_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_button_hover_text_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_button_hover_text_color'] : '#ffffff',
'label' => __( 'Primary hover text', 'booking' ),
'help' => __( 'Used when a submit or primary button is hovered, focused, or active.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_button_hover_text_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => 'booking_form_custom_button_hover_border_color',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_button_hover_border_color'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_button_hover_border_color'] : '#055589',
'label' => __( 'Primary hover border', 'booking' ),
'help' => __( 'Used when a submit or primary button is hovered, focused, or active.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_button_hover_border_color',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
$secondary_button_color_options = array(
'booking_form_custom_secondary_button_background_color' => array( __( 'Secondary button background', 'booking' ), __( 'Used by Previous, Next, lightweight, and Stripe buttons.', 'booking' ), '#fdfdfd' ),
'booking_form_custom_secondary_button_text_color' => array( __( 'Secondary button text', 'booking' ), __( 'Used by Previous, Next, lightweight, and Stripe buttons.', 'booking' ), '#444444' ),
'booking_form_custom_secondary_button_border_color' => array( __( 'Secondary button border', 'booking' ), __( 'Used by Previous, Next, lightweight, and Stripe buttons.', 'booking' ), '#eeeeee' ),
'booking_form_custom_secondary_button_hover_background_color' => array( __( 'Secondary hover background', 'booking' ), __( 'Used when a secondary button is hovered, focused, or active.', 'booking' ), '#fdfdfd' ),
'booking_form_custom_secondary_button_hover_text_color' => array( __( 'Secondary hover text', 'booking' ), __( 'Used when a secondary button is hovered, focused, or active.', 'booking' ), '#444444' ),
'booking_form_custom_secondary_button_hover_border_color' => array( __( 'Secondary hover border', 'booking' ), __( 'Used when a secondary button is hovered, focused, or active.', 'booking' ), '#4d91cd' ),
);
foreach ( $secondary_button_color_options as $option_key => $option_data ) {
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'color',
'key' => $option_key,
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values[ $option_key ] ) ? $wpbc_bfb_custom_style_values[ $option_key ] : $option_data[2],
'label' => $option_data[0],
'help' => $option_data[1],
'attr' => array(
'id' => $option_key,
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'input_attrs' => array(
'pattern' => '^#[0-9A-Fa-f]{6}$',
),
)
);
}
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'length',
'key' => 'booking_form_custom_button_border_width',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_button_border_width'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_button_border_width'] : '1px',
'label' => __( 'Button border width', 'booking' ),
'help' => __( 'Used by primary and secondary buttons when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_button_border_width',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'length' => array(
'default_unit' => 'px',
'units' => array(
'px' => 'px',
'rem' => 'rem',
'em' => 'em',
),
'bounds_map' => array(
'px' => array( 'min' => 0, 'max' => 20, 'step' => 1 ),
'rem' => array( 'min' => 0, 'max' => 5, 'step' => 0.1 ),
'em' => array( 'min' => 0, 'max' => 5, 'step' => 0.1 ),
),
),
)
);
WPBC_BFB_Setting_Options::print_option(
array(
'type' => 'length',
'key' => 'booking_form_custom_button_border_radius',
'scope' => 'global',
'save_ui' => 'when_changed',
'autosave_on_form_save' => true,
'default' => isset( $wpbc_bfb_custom_style_values['booking_form_custom_button_border_radius'] ) ? $wpbc_bfb_custom_style_values['booking_form_custom_button_border_radius'] : '3px',
'label' => __( 'Button corner radius', 'booking' ),
'help' => __( 'Used by primary and secondary buttons when Form style is Custom.', 'booking' ),
'attr' => array(
'id' => 'booking_form_custom_button_border_radius',
),
'row_class' => 'wpbc_bfb__form_setting_global_custom_style',
'row_hidden' => true,
'length' => array(
'default_unit' => 'px',
'units' => array(
'px' => 'px',
'rem' => 'rem',
'em' => 'em',
),
'bounds_map' => array(
'px' => array( 'min' => 0, 'max' => 40, 'step' => 1 ),
'rem' => array( 'min' => 0, 'max' => 5, 'step' => 0.1 ),
'em' => array( 'min' => 0, 'max' => 5, 'step' => 0.1 ),
),
),
)
);
?>