__('Booking Calendar Form', 'booking')
// , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
, 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__general').show();"
, 'font_icon' => 'wpbc-bi-calendar3-range'
, 'default' => true
) );
wpbc_bs_display_tab( array(
'title' => __('Conditional Days Selection', 'booking')
// , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
, 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__conditions').show();"
, 'font_icon' => 'wpbc-bi-calendar2-week'
, 'default' => false
, 'css_classes' => 'wpbc_dismiss__conditional_days'
) );
wpbc_bs_display_tab( array(
'title' => __('Aggregate', 'booking')
// , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
, 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__aggregate').show();"
, 'font_icon' => 'wpbc-bi-calendar2-plus'
, 'default' => false
, 'css_classes' => 'wpbc_dismiss__booking_param_aggregate'
) );
wpbc_bs_display_tab( array(
'title' => __('Advanced', 'booking')
// , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
, 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__other').show();"
, 'font_icon' => 'wpbc_icn_tune'
, 'default' => false
) );
wpbc_bs_toolbar_tabs_html_container_end();
}
// =====================================================================================================================
// Fields
// =====================================================================================================================
/**
* Shortcode Field: Select-box - "Booking Resource"
*
* @param $id
* @param $group_key
*
* @return void
*/
function wpbc_shortcode_config_fields__select_resource( $id , $group_key ){
if ( class_exists( 'wpdev_bk_personal' ) ){
WPBC_Settings_API::field_select_row_static( $id
, array(
'type' => 'select'
, 'title' => __( 'Booking resource', 'booking')
, 'description' => __( 'Select booking resource', 'booking' )
, 'description_tag' => 'span'
, 'label' => ''
, 'multiple' => false
, 'group' => $group_key
, 'tr_class' => $group_key . '_standard_section'
, 'class' => ''
, 'css' => 'margin-right:10px;'
, 'only_field' => false
, 'attr' => array()
, 'value' => ''
, 'options' => wpbc_get_all_booking_resources_list()
) );
}
}
/**
* Shortcode Field: Select-box - "Custom Booking Form"
*
* @param $id
* @param $group_key
*
* @return void
*/
function wpbc_shortcode_config_fields__select_custom_form( $id , $group_key ){
WPBC_FE_Custom_Form_Helper::wpbc_bfb__custom_booking_forms_list__selectbox_html__sh_modal(
array(
'name' => $id,
'title' => __( 'Booking Form', 'booking' ),
'description' => __( 'Select custom booking form', 'booking' ),
'group' => $group_key,
)
);
}
/**
* Shortcode Field: Select-box - "Calendar Months Number"
*
* @param $id
* @param $group_key
*
* @return void
*/
function wpbc_shortcode_config_fields__select_nummonths( $id , $group_key ){
WPBC_Settings_API::field_select_row_static( $id
, array(
'type' => 'select'
, 'title' => __('Visible months', 'booking')
, 'description' => __('Select number of month to show for calendar.' ,'booking')
, 'description_tag' => 'span'
, 'label' => ''
, 'multiple' => false
, 'group' => $group_key
, 'tr_class' => $group_key . '_standard_section'
, 'class' => ''
, 'css' => 'margin-right:10px;'
, 'only_field' => false
, 'attr' => array()
, 'value' => get_bk_option( 'booking_client_cal_count' )
, 'options' => array_combine( range( 1, 12 ), range( 1, 12 ) )
)
);
}
/**
* Shortcode Fields: OPTION - "Define Calendar Size"
*
* @param $id
* @param $group_key
*
* @return void
*/
function wpbc_shortcode_config_fields__calendar_size( $id , $group_key ){
// ---------------------------------------------------------------------------------------------------------
WPBC_Settings_API::field_checkbox_row_static( $id . '_enabled'
, array(
'type' => 'checkbox'
, 'title' => __('Setup Size & Structure', 'booking')
, 'description' => __('Configure Calendar Size and Structure', 'booking')
, 'description_tag' => 'span'
, 'label' => ''
, 'class' => ''
, 'css' => ''
, 'tr_class' => ''
, 'attr' => array()
, 'group' => $group_key
, 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed'
, 'only_field' => !true
, 'is_new_line' => false
, 'value' => false
)
);
WPBC_Settings_API::field_select_row_static( $id . '_months_num_in_row'
, array(
'type' => 'select'
, 'title' => __('Number of months in a row', 'booking')
, 'description' => __('Select the number of months to show in one row on a wide screen.' ,'booking')
, 'description_tag' => 'span'
, 'label' => ''
, 'multiple' => false
, 'group' => $group_key
, 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed ' . $id . '_wpbc_sc_calendar_size'
, 'class' => ''
, 'css' => 'margin-right:10px;'
, 'only_field' => false
, 'attr' => array()
, 'value' => get_bk_option( 'booking_client_cal_count' )
, 'options' => array_combine( range( 1, 6 ), range( 1, 6 ) )
)
);
?>
|
|
|
|
|
'checkbox'
, 'title' => __( 'Open in popup', 'booking' )
, 'description' => __( 'Show a button that opens the booking form in a popup window.', 'booking' )
, 'description_tag' => 'span'
, 'label' => ''
, 'class' => ''
, 'css' => ''
, 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed'
, 'attr' => array()
, 'group' => $group_key
, 'only_field' => false
, 'is_new_line' => false
, 'value' => false
)
);
WPBC_Settings_API::field_text_row_static( $id . '_button_title'
, array(
'type' => 'text'
, 'title' => __( 'Button title', 'booking' )
, 'description' => __( 'Text on the button that opens the booking form popup.', 'booking' )
, 'description_tag' => 'span'
, 'placeholder' => __( 'Book now', 'booking' )
, 'class' => ''
, 'css' => ''
, 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed ' . $id . '_wpbc_sc_booking_popup'
, 'attr' => array()
, 'group' => $group_key
, 'only_field' => false
, 'value' => __( 'Book now', 'booking' )
)
);
WPBC_Settings_API::field_text_row_static( $id . '_title'
, array(
'type' => 'text'
, 'title' => __( 'Popup title', 'booking' )
, 'description' => __( 'Title displayed in the popup header.', 'booking' )
, 'description_tag' => 'span'
, 'placeholder' => __( 'Booking Form', 'booking' )
, 'class' => ''
, 'css' => ''
, 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed ' . $id . '_wpbc_sc_booking_popup'
, 'attr' => array()
, 'group' => $group_key
, 'only_field' => false
, 'value' => __( 'Booking Form', 'booking' )
)
);
WPBC_Settings_API::field_text_row_static( $id . '_button_class'
, array(
'type' => 'text'
, 'title' => __( 'Button CSS class', 'booking' )
, 'description' => __( 'CSS class for the popup button.', 'booking' )
, 'description_tag' => 'span'
, 'placeholder' => 'wp-element-button'
, 'class' => ''
, 'css' => ''
, 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed ' . $id . '_wpbc_sc_booking_popup'
, 'attr' => array()
, 'group' => $group_key
, 'only_field' => false
, 'value' => 'wp-element-button'
)
);
WPBC_Settings_API::field_text_row_static( $id . '_modal_class'
, array(
'type' => 'text'
, 'title' => __( 'Popup CSS class', 'booking' )
, 'description' => __( 'Optional CSS class for the popup modal.', 'booking' )
, 'description_tag' => 'span'
, 'placeholder' => ''
, 'class' => ''
, 'css' => ''
, 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed ' . $id . '_wpbc_sc_booking_popup'
, 'attr' => array()
, 'group' => $group_key
, 'only_field' => false
, 'value' => ''
)
);
WPBC_Settings_API::field_select_row_static( $id . '_size'
, array(
'type' => 'select'
, 'title' => __( 'Popup size', 'booking' )
, 'description' => __( 'Select the popup window size.', 'booking' )
, 'description_tag' => 'span'
, 'label' => ''
, 'multiple' => false
, 'group' => $group_key
, 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed ' . $id . '_wpbc_sc_booking_popup'
, 'class' => ''
, 'css' => 'margin-right:10px;'
, 'only_field' => false
, 'attr' => array()
, 'value' => 'lg'
, 'options' => array(
'lg' => __( 'Large', 'booking' ),
'default' => __( 'Default', 'booking' ),
'sm' => __( 'Small', 'booking' ),
)
)
);
}
/**
* Shortcode Fields: Start Month
*
* @param $id
* @param $group_key
*
* @return void
*/
function wpbc_shortcode_config_fields__start_month( $id , $group_key ){
////////////////////////////////////////////////////////////////////
// Start Month
////////////////////////////////////////////////////////////////////
?>
|
|
|
|
|
|
'widget_wpbc_dismiss__booking_param_aggregate',
'dismiss_css_class' => '.wpbc_dismiss__booking_param_aggregate',
'blured_in_versions' => array( 'free' ),
'feature_link' => array( 'title' => 'feature', 'relative_url' => 'overview/#booking-resources' ),
'upgrade_link' => array( 'title' => 'Upgrade to Pro', 'relative_url' => 'features/#bk_news_section' ),
'versions' => 'paid versions',
'css' => 'transform: translate(0) translateY(180px);'
) );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $upgrade_content_arr['content'];
//--------------------------------------------------------------------------------------------------------------
// Real Content
//--------------------------------------------------------------------------------------------------------------
$resources_list = array();
if ( class_exists( 'wpdev_bk_personal' ) ){
$resources_list_orig = wpbc_get_all_booking_resources_list();
$resources_list[0] = array( 'title' => __('None', 'booking' ), 'attr' => array ( 'class' => 'wpbc_single_resource', 'style' => 'border-bottom:1px dashed #ddd;') );
foreach ($resources_list_orig as $res_id => $res_val) {
$resources_list[$res_id] = $res_val;
}
}
?>
-
-
'
. esc_html__( 'Hold down the Ctrl button to make multiple selections.', 'booking' );
echo ' ' . esc_html__( 'Code Example', 'booking' ) . ': '
. '
[booking resource_id=1 aggregate=\'3;5;9\']';
?>
-
', ''
, 'Booking > Availability > Block Dates'
) );
?>
' . esc_html__( 'Code Example', 'booking' ) . ': '
, '
[booking resource_id=1 aggregate=\'3;5;9\' options=\'{aggregate type=bookings_only}\']';
?>
-
', ''
, '', '' ) );
?>
$id . '_' . 'conditional_days_weekdays',
'dismiss_css_class' => '.wpbc_dismiss__conditional_days',
'blured_in_versions' => array( 'free', 'ps', 'bs' ),
'feature_link' => array( 'title' => 'feature', 'relative_url' => 'overview/#advanced-days-selection' ),
'upgrade_link' => array( 'title' => 'Upgrade to Pro', 'relative_url' => 'features/#bk_news_section' ),
'versions' => 'Business Medium / Large, MultiUser versions',
'css' => 'transform: translate(0) translateY(120px);'
) );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $upgrade_content_arr['content'];
//--------------------------------------------------------------------------------------------------------------
// Conditions for Weekdays selection
//--------------------------------------------------------------------------------------------------------------
?>
-
-
' . esc_html__( 'Code Example', 'booking' ) . ': '
. '
{select-day condition="weekday" for="1" value="5,7"},{select-day condition="weekday" for="6" value="2-7"}';
?>
-
', ''
, '', '' ) );
?>
-
','') );
?>
$id . '_' . 'conditional_days_seasons',
'dismiss_css_class' => '.wpbc_dismiss__conditional_days',
'blured_in_versions' => array( 'free', 'ps', 'bs' ),
'feature_link' => array( 'title' => 'feature', 'relative_url' => 'overview/#advanced-days-selection' ),
'upgrade_link' => array( 'title' => 'Upgrade to Pro', 'relative_url' => 'features/#bk_news_section' ),
'versions' => 'Business Medium / Large, MultiUser versions',
'css' => 'transform: translate(0) translateY(120px);'
) );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $upgrade_content_arr['content'];
//--------------------------------------------------------------------------------------------------------------
// Conditions for Seasons days selection
//--------------------------------------------------------------------------------------------------------------
$options = wpbc_shortcode_config_fields__get_options_for_seasons();
?>
-
-
' . esc_html__( 'Code Example', 'booking' ) . ': '
. '
{select-day condition="season" for="High season" value="7-14,21"},{select-day condition="season" for="Low season" value="2-5"}';
?>
-
', ''
, '', '' ) );
?>
-
','') );
?>
get_data() = [
* 1 => [
* booking_filter_id = "1"
* title = "Weekend"
* filter = "a:4:{s:8:"weekdays";a:7..."
* users = "1"
* id = "1"
*/
$season_filter_arr = $wpbc_sf_cache->get_data();
} else {
$season_filter_arr = array();
}
// $wpbc_br_cache = wpbc_br_cache();
/*
$wpbc_br_cache->get_resources() = [
1 = [
booking_type_id = "1"
title = "Standard"
users = "1"
import = null
export = "/ics/wpbm.ics"
cost = "25"
default_form = "standard"
prioritet = "1"
parent = "0"
visitors = "2"
id = "1"
count = {int} 5
7 = [...
*/
$current_user_id = wpbc_get_current_user_id();
$options = array(
0 => array(
'title' => ' - ' . __( 'Please Select', 'booking' ) . ' - ',
'attr' => array( 'style' => 'color:#999;font-weight: 400;' )
)
);
foreach ( $season_filter_arr as $filter_id => $filter_arr ) {
$options[ $filter_arr['id'] ] = $filter_arr;
// MultiUser functionality for regular users showing season filters.
if ( ( class_exists( 'wpdev_bk_multiuser' ) ) && ( ! empty( $filter_arr['users'] ) ) ) {
// Is current user suer booking admin and if this user was simulated log in
$season_user_id = intval( $filter_arr['users'] );
$is_user_super_admin = apply_bk_filter( 'is_user_super_admin', $season_user_id );
if ( ( ! $is_user_super_admin ) && ( $current_user_id != $season_user_id ) ) {
$options[ $filter_arr['id'] ]['attr'] = array( 'style' => 'color:#a43232;font-weight: 400;font-style: italic;' );
$user_name = get_userdata( $season_user_id );
$user_name = $user_name->display_name;
$options[ $filter_arr['id'] ]['title'] .= ' (' . __( 'Regular User', 'booking' ) . ': ' . $user_name . ')';
}
}
}
return $options;
}
/**
* Season Days Start Day - Condition fields for 'option' parameter.
*
* @param $id
* @param $group_key
*
* @return void
*/
function wpbc_shortcode_config_fields__season_start_day_conditions( $id, $group_key ) {
//--------------------------------------------------------------------------------------------------------------
// 'Upgrade to Pro' widget
//--------------------------------------------------------------------------------------------------------------
$upgrade_content_arr = wpbc_get_upgrade_widget( array(
'id' => $id . '_' . 'conditional_days_startday',
'dismiss_css_class' => '.wpbc_dismiss__conditional_days',
'blured_in_versions' => array( 'free', 'ps', 'bs' ),
'feature_link' => array( 'title' => 'feature', 'relative_url' => 'overview/#advanced-days-selection' ),
'upgrade_link' => array( 'title' => 'Upgrade to Pro', 'relative_url' => 'features/#bk_news_section' ),
'versions' => 'Business Medium / Large, MultiUser versions',
'css' => 'transform: translate(0) translateY(120px);'
) );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $upgrade_content_arr['content'];
//--------------------------------------------------------------------------------------------------------------
// Conditions for Seasons days START selection
//--------------------------------------------------------------------------------------------------------------
$options = wpbc_shortcode_config_fields__get_options_for_seasons();
?>
-
-
' . esc_html__( 'Code Example', 'booking' ) . ': '
. '
{start-day condition="season" for="Low season" value="0,5"}';
?>
-
', ''
, '', '' ) );
?>
-
','') );
?>
$id . '_' . 'conditional_days_fordate',
'dismiss_css_class' => '.wpbc_dismiss__conditional_days',
'blured_in_versions' => array( 'free', 'ps', 'bs' ),
'feature_link' => array( 'title' => 'feature', 'relative_url' => 'overview/#advanced-days-selection' ),
'upgrade_link' => array( 'title' => 'Upgrade to Pro', 'relative_url' => 'features/#bk_news_section' ),
'versions' => 'Business Medium / Large, MultiUser versions',
'css' => 'transform: translate(0) translateY(120px);'
) );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $upgrade_content_arr['content'];
//--------------------------------------------------------------------------------------------------------------
// Conditions for DATE selection
//--------------------------------------------------------------------------------------------------------------
?>
-
-
' . esc_html__( 'Code Example', 'booking' ) . ': '
. '
{select-day condition="date" for="2027-02-15" value="7,14,21"}';
?>
-
', ''
, '', '' ) );
?>
-
','') );
?>
|string> Booking Resource options.
*/
function wpbc_shortcode_config__workflow_resource_options( $include_empty = false, $empty_title = '' ) {
$options = array();
if ( $include_empty ) {
$options[''] = array(
'title' => $empty_title ? $empty_title : __( 'No preselection', 'booking' ),
'attr' => array( 'class' => 'wpbc_single_resource' ),
);
}
$resource_options = function_exists( 'wpbc_get_all_booking_resources_list' )
? (array) wpbc_get_all_booking_resources_list()
: array();
if ( empty( $resource_options ) && function_exists( 'wpbc_booking_resource_selector_get_catalog' ) ) {
foreach ( (array) wpbc_booking_resource_selector_get_catalog( array() ) as $resource_id => $resource ) {
$resource_options[ absint( $resource_id ) ] = array(
'title' => ! empty( $resource['title'] ) ? $resource['title'] : sprintf( __( 'Booking Resource #%d', 'booking' ), absint( $resource_id ) ),
'attr' => array( 'class' => 'wpbc_single_resource' ),
);
}
}
if ( empty( $resource_options ) && function_exists( 'wpbc_appointment_services_get_provider_options' ) ) {
foreach ( (array) wpbc_appointment_services_get_provider_options() as $resource_id => $resource_title ) {
$resource_options[ absint( $resource_id ) ] = array(
'title' => $resource_title,
'attr' => array( 'class' => 'wpbc_single_resource' ),
);
}
}
return $options + $resource_options;
}
/**
* Return the automatic, standard, and published Booking Form choices.
*
* The empty option is important for both workflow shortcodes: it preserves
* their automatic Service/Resource form resolution instead of silently
* forcing the Standard form merely by opening the popup.
*
* @return array> Booking Form options keyed by public form slug.
*/
function wpbc_shortcode_config__workflow_form_options() {
$options = array(
'' => array( 'title' => __( 'Automatic (Service or Resource default)', 'booking' ), 'attr' => array() ),
'standard' => array( 'title' => __( 'Standard', 'booking' ), 'attr' => array() ),
);
if ( ! class_exists( 'WPBC_FE_Custom_Form_Helper' ) ) {
return $options;
}
$is_allowed = apply_bk_filter( 'multiuser_is_user_can_be_here', true, 'only_super_admin' );
if ( ! $is_allowed && 'On' !== get_bk_option( 'booking_is_custom_forms_for_regular_users' ) ) {
return $options;
}
$owner_user_id = WPBC_FE_Custom_Form_Helper::wpbc_mu__get_current__owner_user_id();
$custom_forms = WPBC_FE_Custom_Form_Helper::get_custom_booking_forms_list(
array(
'include_standard' => false,
'owner_user_id' => $owner_user_id,
'statuses' => array( 'published' ),
'list_mode' => 'auto',
)
);
if ( empty( $custom_forms ) ) {
return $options;
}
$options['wpbc_workflow_forms_start'] = array(
'optgroup' => true,
'close' => false,
'title' => ' ' . __( 'Custom Forms', 'booking' ),
);
foreach ( $custom_forms as $form_key => $custom_form ) {
$form_slug = ! empty( $custom_form['name'] ) ? (string) $custom_form['name'] : (string) $form_key;
if ( '' === $form_slug ) {
continue;
}
$options[ $form_slug ] = array(
'title' => ! empty( $custom_form['title'] ) ? wpbc_lang( $custom_form['title'] ) : wpbc_lang( $form_slug ),
'attr' => array(),
);
}
$options['wpbc_workflow_forms_end'] = array( 'optgroup' => true, 'close' => true );
return $options;
}
/**
* Render one modern workflow shortcode parameter using the established settings-row controls.
*
* Data attributes on the control provide one serializer contract. Display-text
* defaults are placed in the input so clearing a value intentionally generates
* an empty attribute instead of silently restoring the frontend default.
*
* @param string $shortcode_name Shortcode name without brackets.
* @param string $parameter_name Public shortcode parameter name.
* @param array $field Field label, description, type, default, and validation metadata.
*
* @return void
*/
function wpbc_shortcode_config__workflow_field( $shortcode_name, $parameter_name, $field ) {
$field = wp_parse_args(
$field,
array(
'title' => $parameter_name,
'description' => '',
'type' => 'text',
'value_type' => 'text',
'default' => '',
'placeholder' => '',
'options' => array(),
'attr' => array(),
'css' => 'width:100%;max-width:32em;',
'class' => '',
)
);
$field_id = $shortcode_name . '_wpbc_' . $parameter_name;
$field_attr = array_merge(
(array) $field['attr'],
array(
'data-wpbc-shortcode-parameter' => $parameter_name,
'data-wpbc-shortcode-default' => is_bool( $field['default'] ) ? ( $field['default'] ? 'on' : 'off' ) : (string) $field['default'],
'data-wpbc-shortcode-value-type' => $field['value_type'],
)
);
$description = sprintf(
/* translators: %s: Shortcode parameter name. */
__( 'Shortcode parameter: %s', 'booking' ),
'' . esc_html( $parameter_name ) . ''
);
if ( '' !== $field['description'] ) {
$description .= '
' . $field['description'];
}
$common_args = array(
'title' => $field['title'],
'description' => $description,
'description_tag' => 'span',
'group' => $shortcode_name,
'tr_class' => $shortcode_name . '_standard_section',
'class' => trim( 'wpbc_shortcode_config__workflow_parameter ' . $field['class'] ),
'css' => $field['css'],
'only_field' => false,
'attr' => $field_attr,
);
if ( 'checkbox' === $field['type'] ) {
WPBC_Settings_API::field_checkbox_row_static(
$field_id,
array_merge(
$common_args,
array(
'label' => $field['title'],
'value' => $field['default'] ? 'On' : 'Off',
'css' => '',
)
)
);
return;
}
if ( in_array( $field['type'], array( 'select', 'multiselect' ), true ) ) {
WPBC_Settings_API::field_select_row_static(
$field_id,
array_merge(
$common_args,
array(
'value' => (string) $field['default'],
'options' => (array) $field['options'],
'multiple' => 'multiselect' === $field['type'],
)
)
);
return;
}
WPBC_Settings_API::field_text_row_static(
$field_id,
array_merge(
$common_args,
array(
'type' => 'number' === $field['type'] ? 'number' : 'text',
'value' => (string) $field['default'],
'placeholder' => $field['placeholder'],
)
)
);
}
/**
* Render top tabs for one modern workflow shortcode configuration.
*
* @param string $shortcode_name Shortcode name without brackets.
* @param array> $tabs Tab definitions keyed by section ID.
*
* @return void
*/
function wpbc_shortcode_config__workflow_tabs( $shortcode_name, $tabs ) {
wpbc_bs_toolbar_tabs_html_container_start();
$tab_script = "jQuery(this).parents( '.wpbc_sc_container__shortcode' ).find( '.nav-tab' ).removeClass('nav-tab-active');"
. "jQuery(this).addClass('nav-tab-active');"
. "jQuery('.nav-tab i.icon-white').removeClass('icon-white');"
. "jQuery('.nav-tab-active i').addClass('icon-white');"
. "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section').hide();";
foreach ( $tabs as $section_id => $tab ) {
wpbc_bs_display_tab(
array(
'title' => $tab['title'],
'onclick' => $tab_script . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . ' .wpbc_sc_container__shortcode_section__' . $section_id . "').show();",
'font_icon' => $tab['icon'],
'default' => ! empty( $tab['default'] ),
)
);
}
wpbc_bs_toolbar_tabs_html_container_end();
}
/**
* Render the standard previous/next controls used by shortcode popup sections.
*
* @return void
*/
function wpbc_shortcode_config__workflow_pager() {
?>
$parameters Parameter descriptions keyed by accepted shortcode name.
*
* @return void
*/
function wpbc_shortcode_config__workflow_parameter_reference( $parameters ) {
?>
> Appointment parameter fields.
*/
function wpbc_shortcode_config__booking_appointment_parameters() {
$month_options = array_combine( range( 1, 24 ), range( 1, 24 ) );
$parameters = array(
'service_id' => array(
'section' => 'general', 'title' => __( 'Preselected Service', 'booking' ), 'type' => 'number', 'value_type' => 'positive_integer', 'default' => '',
'description' => __( 'Preselect and restrict the flow to one positive Service ID.', 'booking' ), 'attr' => array( 'min' => 1, 'step' => 1 ),
),
'provider_id' => array(
'section' => 'general', 'title' => __( 'Preselected Provider', 'booking' ), 'type' => 'select', 'value_type' => 'positive_integer', 'default' => '',
'options' => wpbc_shortcode_config__workflow_resource_options( true, __( 'No Provider preselected', 'booking' ) ),
'description' => __( 'Preselect and restrict the flow to one Provider Booking Resource.', 'booking' ),
),
'services' => array(
'section' => 'general', 'title' => __( 'Allowed Services', 'booking' ), 'value_type' => 'id_list', 'default' => '', 'placeholder' => '12,15',
'description' => __( 'Comma-, semicolon-, or whitespace-separated positive Service IDs, retained in the requested order.', 'booking' ),
),
'providers' => array(
'section' => 'general', 'title' => __( 'Allowed Providers', 'booking' ), 'type' => 'multiselect', 'value_type' => 'id_list', 'default' => '',
'options' => wpbc_shortcode_config__workflow_resource_options(), 'css' => 'width:100%;max-width:32em;height:12em;',
'description' => __( 'Select the Provider Booking Resources allowed in this Appointment flow. Leave every option unselected to allow all compatible Providers.', 'booking' ),
),
'auto_select_provider' => array(
'section' => 'general', 'title' => __( 'Auto-select the only Provider', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => false,
'description' => __( 'Skip Provider selection only when exactly one compatible Provider exists.', 'booking' ),
),
'catalog_layout' => array(
'section' => 'catalog', 'title' => __( 'Catalog layout', 'booking' ), 'type' => 'select', 'value_type' => 'text', 'default' => 'grid',
'options' => array( 'grid' => __( 'Responsive grid', 'booking' ), 'list' => __( 'List', 'booking' ) ),
'description' => __( 'Show Services and Providers as responsive cards or compact list items. Selecting List applies recommended display settings that you can adjust afterward.', 'booking' ),
),
'show_resource_filters' => array(
'section' => 'catalog', 'title' => __( 'Show catalog search', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => false,
'description' => __( 'Let visitors search the permitted Services or compatible Providers on the active selection screen.', 'booking' ),
),
'show_resource_image' => array(
'section' => 'catalog', 'title' => __( 'Show images', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show configured Service pictures and Provider photos or generated initials.', 'booking' ),
),
'show_resource_title' => array(
'section' => 'catalog', 'title' => __( 'Show titles', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show Service and Provider titles. Each title remains available to assistive technology when hidden.', 'booking' ),
),
'show_resource_description' => array(
'section' => 'catalog', 'title' => __( 'Show Service descriptions', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show the public Service description when one is configured.', 'booking' ),
),
'catalog_item_width' => array(
'section' => 'catalog', 'title' => __( 'Catalog item width', 'booking' ), 'value_type' => 'css_width', 'default' => '',
'placeholder' => __( 'Automatic, 360px, or 50%', 'booking' ),
'description' => __( 'Optional explicit card or list-row width. Use px, %, em, rem, or vw. An items-per-row setting takes precedence for its active layout.', 'booking' ),
),
'catalog_item_max_width' => array(
'section' => 'catalog', 'title' => __( 'Maximum catalog item width', 'booking' ), 'type' => 'number', 'value_type' => 'positive_integer', 'default' => '',
'placeholder' => __( 'Automatic', 'booking' ), 'attr' => array( 'min' => 280, 'max' => 1200, 'step' => 1 ),
'description' => __( 'Optional maximum card or list-row width in pixels, from 280 through 1200. Leave empty to fill the available layout width.', 'booking' ),
),
'catalog_grid_items_per_row' => array(
'section' => 'catalog', 'title' => __( 'Grid items per row', 'booking' ), 'type' => 'number', 'value_type' => 'positive_integer', 'default' => '',
'placeholder' => __( 'Automatic', 'booking' ), 'attr' => array( 'min' => 1, 'max' => 12, 'step' => 1 ),
'description' => __( 'Optional exact number of equal-width items per row in the grid layout, from 1 through 12.', 'booking' ),
),
'catalog_list_items_per_row' => array(
'section' => 'catalog', 'title' => __( 'List items per row', 'booking' ), 'type' => 'number', 'value_type' => 'positive_integer', 'default' => '',
'placeholder' => __( 'One item per row', 'booking' ), 'attr' => array( 'min' => 1, 'max' => 12, 'step' => 1 ),
'description' => __( 'Optional number of equal-width items per row in the list layout, from 1 through 12. Empty keeps one item per row.', 'booking' ),
),
'show_resource_hierarchy' => array(
'section' => 'catalog', 'title' => __( 'Show Service relationship', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Explain that each listed Provider offers the selected Service.', 'booking' ),
),
'show_availability' => array(
'section' => 'catalog', 'title' => __( 'Show availability summary', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show when a Provider has no weekly availability configured. Exact availability remains confirmed after dates are selected.', 'booking' ),
),
'show_starting_price' => array(
'section' => 'catalog', 'title' => __( 'Show starting price', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show the effective Service or Provider price when pricing is available in this edition.', 'booking' ),
),
'nummonths' => array(
'section' => 'calendar', 'title' => __( 'Visible months', 'booking' ), 'type' => 'select', 'value_type' => 'positive_integer', 'default' => 1, 'options' => $month_options,
'description' => __( 'Number of calendar months from 1 through 24.', 'booking' ),
),
'startmonth' => array(
'section' => 'calendar', 'title' => __( 'Start month', 'booking' ), 'value_type' => 'month', 'default' => '', 'placeholder' => '2026-08',
'description' => __( 'Initial calendar month in YYYY-MM, YYYY/MM, or YYYYMM format.', 'booking' ),
),
'calendar_dates_start' => array(
'section' => 'calendar', 'title' => __( 'First calendar date', 'booking' ), 'value_type' => 'date', 'default' => '', 'placeholder' => '2026-08-01',
'description' => __( 'Inclusive first displayed date in YYYY-MM-DD format.', 'booking' ),
),
'calendar_dates_end' => array(
'section' => 'calendar', 'title' => __( 'Last calendar date', 'booking' ), 'value_type' => 'date', 'default' => '', 'placeholder' => '2026-12-31',
'description' => __( 'Inclusive last displayed date in YYYY-MM-DD format.', 'booking' ),
),
'options' => array(
'section' => 'calendar', 'title' => __( 'Calendar options', 'booking' ), 'value_type' => 'text', 'default' => '',
'description' => __( 'Native Booking Calendar options string passed to the resolved calendar and form.', 'booking' ),
),
'form_type' => array(
'section' => 'calendar', 'title' => __( 'Booking Form', 'booking' ), 'type' => 'select', 'value_type' => 'text', 'default' => '',
'options' => wpbc_shortcode_config__workflow_form_options(),
'description' => __( 'Select a published Booking Form override. Automatic uses the Service form and then the Standard form.', 'booking' ),
),
'allow_past' => array(
'section' => 'calendar', 'title' => __( 'Allow past bookings', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => false,
'description' => __( 'Permit any visitor to select and submit past dates inside the signed shortcode range.', 'booking' ),
),
'show_progress' => array(
'section' => 'progress', 'title' => __( 'Show progress', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show the complete numbered Appointment progress line.', 'booking' ),
),
'progress_item_1_title' => array(
'section' => 'progress', 'title' => __( 'First progress title', 'booking' ), 'default' => __( 'Service', 'booking' ),
'description' => __( 'Title below the first progress number. Clear it to hide the title.', 'booking' ),
),
'progress_item_1_number' => array(
'section' => 'progress', 'title' => __( 'First progress number', 'booking' ), 'default' => '1',
'description' => __( 'First displayed progress number. Clear it to hide the number.', 'booking' ),
),
'progress_item_2_title' => array(
'section' => 'progress', 'title' => __( 'Second progress title', 'booking' ), 'default' => __( 'Provider', 'booking' ),
'description' => __( 'Title below the second progress number. Clear it to hide the title.', 'booking' ),
),
'progress_item_2_number' => array(
'section' => 'progress', 'title' => __( 'Second progress number', 'booking' ), 'default' => '2',
'description' => __( 'Second displayed progress number. Clear it to hide the number.', 'booking' ),
),
'progress_item_3_title' => array(
'section' => 'progress', 'title' => __( 'Third progress title', 'booking' ), 'default' => __( 'Date & Details', 'booking' ),
'description' => __( 'Title below the third progress number. Clear it to hide the title.', 'booking' ),
),
'progress_item_3_number' => array(
'section' => 'progress', 'title' => __( 'Third progress number', 'booking' ), 'default' => '3',
'description' => __( 'Third displayed progress number. Clear it to hide the number.', 'booking' ),
),
'screen_1_title' => array(
'section' => 'text', 'title' => __( 'Service screen title', 'booking' ), 'default' => __( 'Choose a Service', 'booking' ),
'description' => __( 'Heading on the Service selection screen. Clear it to hide the heading.', 'booking' ),
),
'screen_1_description' => array(
'section' => 'text', 'title' => __( 'Service screen description', 'booking' ), 'default' => __( 'Select what you would like to book.', 'booking' ),
'description' => __( 'Description on the Service selection screen. Clear it to hide the description.', 'booking' ),
),
'screen_2_title' => array(
'section' => 'text', 'title' => __( 'Provider screen title', 'booking' ), 'default' => __( 'Choose a Provider', 'booking' ),
'description' => __( 'Heading on the Provider selection screen. Clear it to hide the heading.', 'booking' ),
),
'screen_2_description' => array(
'section' => 'text', 'title' => __( 'Provider screen description', 'booking' ), 'default' => __( 'Select who will provide this Service.', 'booking' ),
'description' => __( 'Description on the Provider selection screen. Clear it to hide the description.', 'booking' ),
),
);
if ( ! function_exists( 'wpbc_is_11_6_features_enabled' ) || ! wpbc_is_11_6_features_enabled() ) {
unset(
$parameters['catalog_layout'],
$parameters['show_resource_filters'],
$parameters['show_resource_image'],
$parameters['show_resource_title'],
$parameters['show_resource_description'],
$parameters['catalog_item_width'],
$parameters['catalog_item_max_width'],
$parameters['catalog_grid_items_per_row'],
$parameters['catalog_list_items_per_row'],
$parameters['show_resource_hierarchy'],
$parameters['show_availability'],
$parameters['show_starting_price']
);
}
return $parameters;
}
/**
* Get every accepted public Appointment shortcode parameter for the reference tab.
*
* @return array Parameter descriptions keyed by public attribute.
*/
function wpbc_shortcode_config__booking_appointment_parameter_reference() {
$reference = array();
foreach ( wpbc_shortcode_config__booking_appointment_parameters() as $parameter_name => $field ) {
$reference[ $parameter_name ] = $field['description'];
}
$reference['progress_service_title'] = __( 'Compatibility alias for progress_item_1_title.', 'booking' );
$reference['progress_service_number'] = __( 'Compatibility alias for progress_item_1_number.', 'booking' );
$reference['progress_provider_title'] = __( 'Compatibility alias for progress_item_2_title.', 'booking' );
$reference['progress_provider_number'] = __( 'Compatibility alias for progress_item_2_number.', 'booking' );
$reference['progress_details_title'] = __( 'Compatibility alias for progress_item_3_title.', 'booking' );
$reference['progress_details_number'] = __( 'Compatibility alias for progress_item_3_number.', 'booking' );
return $reference;
}
/**
* Render the [booking_appointment] configuration section in the shortcode popup.
*
* @return void
*/
function wpbc_shortcode_config__content__booking_appointment() {
$shortcode_name = 'booking_appointment';
$tabs = array(
'general' => array( 'title' => __( 'Service & Provider', 'booking' ), 'icon' => 'wpbc-bi-person-check', 'default' => true ),
'catalog' => array( 'title' => __( 'Catalog', 'booking' ), 'icon' => 'wpbc-bi-grid', 'default' => false ),
'calendar' => array( 'title' => __( 'Calendar & Form', 'booking' ), 'icon' => 'wpbc-bi-calendar3', 'default' => false ),
'progress' => array( 'title' => __( 'Progress', 'booking' ), 'icon' => 'wpbc-bi-list-ol', 'default' => false ),
'text' => array( 'title' => __( 'Screen Text', 'booking' ), 'icon' => 'wpbc-bi-card-text', 'default' => false ),
'reference' => array( 'title' => __( 'Parameters', 'booking' ), 'icon' => 'wpbc-bi-code-square', 'default' => false ),
);
if ( ! function_exists( 'wpbc_is_11_6_features_enabled' ) || ! wpbc_is_11_6_features_enabled() ) {
unset( $tabs['catalog'] );
}
$parameters = wpbc_shortcode_config__booking_appointment_parameters();
?>
> Resource Selector parameter fields.
*/
function wpbc_shortcode_config__booking_resource_selector_parameters() {
$month_options = array_combine( range( 1, 24 ), range( 1, 24 ) );
$parameters = array(
'resource_id' => array(
'section' => 'general', 'title' => __( 'Preselected Booking Resource', 'booking' ), 'type' => 'select', 'value_type' => 'positive_integer', 'default' => '',
'options' => wpbc_shortcode_config__workflow_resource_options( true, __( 'No Booking Resource preselected', 'booking' ) ),
'description' => __( 'Check one Booking Resource by default without skipping the selection stage.', 'booking' ),
),
'resources' => array(
'section' => 'general', 'title' => __( 'Allowed Booking Resources', 'booking' ), 'type' => 'multiselect', 'value_type' => 'id_list', 'default' => '',
'options' => wpbc_shortcode_config__workflow_resource_options(), 'css' => 'width:100%;max-width:32em;height:12em;',
'description' => __( 'Select the Booking Resources shown by this workflow. Leave every option unselected to allow all available Resources.', 'booking' ),
),
'aggregate' => array(
'section' => 'general', 'title' => __( 'Aggregate Booking Resources', 'booking' ), 'type' => 'multiselect', 'value_type' => 'id_list', 'default' => '',
'options' => wpbc_shortcode_config__workflow_resource_options(), 'css' => 'width:100%;max-width:32em;height:12em;',
'description' => __( 'Select Booking Resources whose bookings should also block availability in the selected primary Resource.', 'booking' ),
),
'auto_select_resource' => array(
'section' => 'general', 'title' => __( 'Auto-select Booking Resource', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => false,
'description' => __( 'Open the preselected Resource immediately, or skip selection when exactly one Resource is available.', 'booking' ),
),
'catalog_layout' => array(
'section' => 'catalog', 'title' => __( 'Resource layout', 'booking' ), 'type' => 'select', 'value_type' => 'text', 'default' => 'grid',
'options' => array( 'grid' => __( 'Responsive grid', 'booking' ), 'list' => __( 'List', 'booking' ) ),
'description' => __( 'Show Booking Resources as responsive cards or compact list items. Selecting List applies recommended display settings that you can adjust afterward.', 'booking' ),
),
'show_resource_filters' => array(
'section' => 'catalog', 'title' => __( 'Show Resource search', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => false,
'description' => __( 'Let visitors search the permitted Resources by title, description, or parent title.', 'booking' ),
),
'show_resource_image' => array(
'section' => 'catalog', 'title' => __( 'Show Resource image', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show the Resource photo or its generated initials.', 'booking' ),
),
'show_resource_title' => array(
'section' => 'catalog', 'title' => __( 'Show Resource title', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show the public Resource title. The title remains available to assistive technology when hidden.', 'booking' ),
),
'show_resource_description' => array(
'section' => 'catalog', 'title' => __( 'Show Resource description', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show the public Resource description when one is configured.', 'booking' ),
),
'catalog_item_width' => array(
'section' => 'catalog', 'title' => __( 'Resource item width', 'booking' ), 'value_type' => 'css_width', 'default' => '',
'placeholder' => __( 'Automatic, 360px, or 50%', 'booking' ),
'description' => __( 'Optional explicit card or list-row width. Use px, %, em, rem, or vw. An items-per-row setting takes precedence for its active layout.', 'booking' ),
),
'catalog_item_max_width' => array(
'section' => 'catalog', 'title' => __( 'Maximum Resource item width', 'booking' ), 'type' => 'number', 'value_type' => 'positive_integer', 'default' => '',
'placeholder' => __( 'Automatic', 'booking' ), 'attr' => array( 'min' => 280, 'max' => 1200, 'step' => 1 ),
'description' => __( 'Optional maximum card or list-row width in pixels, from 280 through 1200. Leave empty to fill the available layout width.', 'booking' ),
),
'catalog_grid_items_per_row' => array(
'section' => 'catalog', 'title' => __( 'Grid items per row', 'booking' ), 'type' => 'number', 'value_type' => 'positive_integer', 'default' => '',
'placeholder' => __( 'Automatic', 'booking' ), 'attr' => array( 'min' => 1, 'max' => 12, 'step' => 1 ),
'description' => __( 'Optional exact number of equal-width items per row in the grid layout, from 1 through 12.', 'booking' ),
),
'catalog_list_items_per_row' => array(
'section' => 'catalog', 'title' => __( 'List items per row', 'booking' ), 'type' => 'number', 'value_type' => 'positive_integer', 'default' => '',
'placeholder' => __( 'One item per row', 'booking' ), 'attr' => array( 'min' => 1, 'max' => 12, 'step' => 1 ),
'description' => __( 'Optional number of equal-width items per row in the list layout, from 1 through 12. Empty keeps one item per row.', 'booking' ),
),
'show_resource_hierarchy' => array(
'section' => 'catalog', 'title' => __( 'Show Resource hierarchy', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show parent capacity and child-unit context without exposing administration controls. Independent Resources do not need a hierarchy badge.', 'booking' ),
),
'show_availability' => array(
'section' => 'catalog', 'title' => __( 'Show availability summary', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Explain that exact availability is confirmed after dates are selected.', 'booking' ),
),
'show_starting_price' => array(
'section' => 'catalog', 'title' => __( 'Show starting price', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show the Resource base price and charging period when pricing is available in this edition.', 'booking' ),
),
'nummonths' => array(
'section' => 'calendar', 'title' => __( 'Visible months', 'booking' ), 'type' => 'select', 'value_type' => 'positive_integer', 'default' => 1, 'options' => $month_options,
'description' => __( 'Number of calendar months from 1 through 24.', 'booking' ),
),
'startmonth' => array(
'section' => 'calendar', 'title' => __( 'Start month', 'booking' ), 'value_type' => 'month', 'default' => '', 'placeholder' => '2026-08',
'description' => __( 'Initial calendar month in YYYY-MM, YYYY/MM, or YYYYMM format.', 'booking' ),
),
'calendar_dates_start' => array(
'section' => 'calendar', 'title' => __( 'First calendar date', 'booking' ), 'value_type' => 'date', 'default' => '', 'placeholder' => '2026-08-01',
'description' => __( 'Inclusive first displayed date in YYYY-MM-DD format.', 'booking' ),
),
'calendar_dates_end' => array(
'section' => 'calendar', 'title' => __( 'Last calendar date', 'booking' ), 'value_type' => 'date', 'default' => '', 'placeholder' => '2026-12-31',
'description' => __( 'Inclusive last displayed date in YYYY-MM-DD format.', 'booking' ),
),
'selected_dates' => array(
'section' => 'calendar', 'title' => __( 'Preselected dates', 'booking' ), 'value_type' => 'text', 'default' => '', 'placeholder' => '01.08.2026',
'description' => __( 'Native Booking Calendar preselected-date expression.', 'booking' ),
),
'options' => array(
'section' => 'calendar', 'title' => __( 'Calendar options', 'booking' ), 'value_type' => 'text', 'default' => '',
'description' => __( 'Native Booking Calendar options string passed to the selected calendar and form.', 'booking' ),
),
'form_type' => array(
'section' => 'calendar', 'title' => __( 'Booking Form', 'booking' ), 'type' => 'select', 'value_type' => 'text', 'default' => '',
'options' => wpbc_shortcode_config__workflow_form_options(),
'description' => __( 'Select a published Booking Form override. Automatic uses the Resource form and then the Standard form.', 'booking' ),
),
'allow_past' => array(
'section' => 'calendar', 'title' => __( 'Allow past bookings', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => false,
'description' => __( 'Permit any visitor to select and submit past dates inside the signed shortcode range.', 'booking' ),
),
'show_progress' => array(
'section' => 'progress', 'title' => __( 'Show progress', 'booking' ), 'type' => 'checkbox', 'value_type' => 'boolean', 'default' => true,
'description' => __( 'Show the complete two-step Resource selection progress line.', 'booking' ),
),
'progress_item_1_title' => array(
'section' => 'progress', 'title' => __( 'First progress title', 'booking' ), 'default' => __( 'Resource', 'booking' ),
'description' => __( 'Title below the first progress number. Clear it to hide the title.', 'booking' ),
),
'progress_item_1_number' => array(
'section' => 'progress', 'title' => __( 'First progress number', 'booking' ), 'default' => '1',
'description' => __( 'First displayed progress number. Clear it to hide the number.', 'booking' ),
),
'progress_item_2_title' => array(
'section' => 'progress', 'title' => __( 'Second progress title', 'booking' ), 'default' => __( 'Date & Details', 'booking' ),
'description' => __( 'Title below the second progress number. Clear it to hide the title.', 'booking' ),
),
'progress_item_2_number' => array(
'section' => 'progress', 'title' => __( 'Second progress number', 'booking' ), 'default' => '2',
'description' => __( 'Second displayed progress number. Clear it to hide the number.', 'booking' ),
),
'screen_1_title' => array(
'section' => 'text', 'title' => __( 'Resource screen title', 'booking' ), 'default' => __( 'Choose a Booking Resource', 'booking' ),
'description' => __( 'Heading on the Booking Resource selection screen. Clear it to hide the heading.', 'booking' ),
),
'screen_1_description' => array(
'section' => 'text', 'title' => __( 'Resource screen description', 'booking' ), 'default' => __( 'Select what you would like to book.', 'booking' ),
'description' => __( 'Description on the Booking Resource selection screen. Clear it to hide the description.', 'booking' ),
),
);
if ( ! function_exists( 'wpbc_is_11_6_features_enabled' ) || ! wpbc_is_11_6_features_enabled() ) {
unset(
$parameters['catalog_layout'],
$parameters['show_resource_filters'],
$parameters['show_resource_image'],
$parameters['show_resource_title'],
$parameters['show_resource_description'],
$parameters['catalog_item_width'],
$parameters['catalog_item_max_width'],
$parameters['catalog_grid_items_per_row'],
$parameters['catalog_list_items_per_row'],
$parameters['show_resource_hierarchy'],
$parameters['show_availability'],
$parameters['show_starting_price']
);
}
return $parameters;
}
/**
* Get every accepted public Resource Selector shortcode parameter for the reference tab.
*
* @return array Parameter descriptions keyed by public attribute.
*/
function wpbc_shortcode_config__booking_resource_selector_parameter_reference() {
$parameters = wpbc_shortcode_config__booking_resource_selector_parameters();
$reference = array();
foreach ( $parameters as $parameter_name => $field ) {
$reference[ $parameter_name ] = $field['description'];
}
$reference['type'] = __( 'Compatibility alias for resources. The resources parameter wins when both are present.', 'booking' );
$reference['selected_resource_id'] = __( 'Compatibility fallback that checks one Resource without skipping selection. resource_id wins when both are present.', 'booking' );
$reference['selected_type'] = __( 'Compatibility alias for selected_resource_id.', 'booking' );
$reference['label'] = __( 'Compatibility alias for screen_1_title.', 'booking' );
return $reference;
}
/**
* Render the [booking_resource_selector] configuration section in the shortcode popup.
*
* @return void
*/
function wpbc_shortcode_config__content__booking_resource_selector() {
$shortcode_name = 'booking_resource_selector';
$tabs = array(
'general' => array( 'title' => __( 'Resource Selection', 'booking' ), 'icon' => 'wpbc-bi-card-checklist', 'default' => true ),
'catalog' => array( 'title' => __( 'Catalog', 'booking' ), 'icon' => 'wpbc-bi-grid', 'default' => false ),
'calendar' => array( 'title' => __( 'Calendar & Form', 'booking' ), 'icon' => 'wpbc-bi-calendar3', 'default' => false ),
'progress' => array( 'title' => __( 'Progress', 'booking' ), 'icon' => 'wpbc-bi-list-ol', 'default' => false ),
'text' => array( 'title' => __( 'Screen Text', 'booking' ), 'icon' => 'wpbc-bi-card-text', 'default' => false ),
'reference' => array( 'title' => __( 'Parameters', 'booking' ), 'icon' => 'wpbc-bi-code-square', 'default' => false ),
);
if ( ! function_exists( 'wpbc_is_11_6_features_enabled' ) || ! wpbc_is_11_6_features_enabled() ) {
unset( $tabs['catalog'] );
}
$parameters = wpbc_shortcode_config__booking_resource_selector_parameters();
?>