Хуки та фільтри

Налаштування кнопок навігації в календарі

Цей фільтр дозволяє оформлювати або змінювати вигляд кнопок навігації календаря. Використовуйте його, щоб додати власні елементи оформлення, заголовки або додатковий вміст навколо кнопок навігації. Безперебійно працює з оновленнями календаря за допомогою AJAX.

/**
 * FILTER: bbc_calendar_navigate_buttons
 */

// Custom BBC header
add_filter( 'bbc_calendar_navigate_buttons', function( $html ) {
    array_unshift( $html, [
        'selector' => 'h3',
        'classes'  => [ 'calendar-header-title' => true ],
        'content'  => __( 'Select Your Time', 'bazadev' ) . 
                      '<span>' . __( 'Discounts apply for bookings of 3 hours or more.', 'bazadev' ) . '</span>',
    ]);

    return [
        [
            'selector' => 'div',
            'classes'  => [ 'calendar-buttons-wrapper' => true ],
            'children' => $html,
        ]
    ];
}, 10, 1 );

// Custom BBC button text
add_filter( 'bbc_calendar_button_prev_text', function( $text ) {
    return '<span class="button-text">' . __( 'Previous', 'bazadev' ) . '</span>';
});

// Custom BBC button text
add_filter( 'bbc_calendar_button_next_text', function( $text ) {
    return '<span class="button-text">' . __( 'Next', 'bazadev' ) . '</span>';
});

Фільтри для налаштування календаря та форм

/**
 * BBC Calendar and Form Filters Documentation
 */

// Add content before the entire form
add_filter( 'bbc_outside_before_form', function( $content ) {
    $content .= '<div class="booking-promo-banner">
        <h2>Special Offer: 20% Off This Week!</h2>
    </div>';
    return $content;
});

// Replace content after the entire form
add_filter( 'bbc_outside_after_form', function( $content ) {
    $content = '<div class="booking-promo-banner">
        <h2>Special Offer: 20% Off This Week!</h2>
    </div>';
    return $content;
});

// Add content before the booking form block
add_filter( 'bbc_before_booking_form', function( $content ) {
    $content .= '<p class="booking-note">Please fill in all required fields carefully.</p>';
    return $content;
});

// Add content after the booking form block
add_filter( 'bbc_after_booking_form', function( $content ) {
    $content .= '<p class="booking-note">Thank you for booking with us!</p>';
    return $content;
});

// Add content before the submit button
add_filter( 'bbc_before_submit_button', function( $content ) {
    $content .= '<p class="submit-note">Make sure all information is correct before submitting.</p>';
    return $content;
});

// Add content after the submit button
add_filter( 'bbc_after_submit_button', function( $content ) {
    $content .= '<p class="submit-note">You will receive a confirmation email shortly after submitting.</p>';
    return $content;
});

// Add content inside the form, before main fields
add_filter( 'bbc_inside_before_form', function( $content ) {
    $content .= '<div class="form-intro">
        <p>Please select your preferred time slots below:</p>
    </div>';
    return $content;
});

// Add content inside the form, after main fields
add_filter( 'bbc_inside_after_form', function( $content ) {
    $content .= '<div class="form-footer-note">
        <p>Need help? Contact our support team for assistance.</p>
    </div>';
    return $content;
});

// Add content before additional services button
add_filter( 'bbc_before_additional_services_button', function( $content ) {
    $content .= '<div class="bbc-before-additional-services-button">
        <p>Before additional services button text.</p>
    </div>';
    return $content;
});

// Add content after additional services button
add_filter( 'bbc_after_additional_services_button', function( $content ) {
    $content .= '<div class="bbc-after-additional-services-button">
        <p>After additional services button text.</p>
    </div>';
    return $content;
});

// Change "Get payment link" text
add_filter( 'bbc_form_checkbox_get_payment_url_text', function( $text ) {
    return __( 'Send payment link to email', 'your-theme' );
});

// Change "Request invoice" text
add_filter( 'bbc_form_checkbox_request_invoice_text', function( $text ) {
    return __( 'I need an invoice', 'your-theme' );
});

// Change partial payment text
add_filter( 'bbc_form_checkbox_partial_payment_text', function( $text ) {
    return __( 'Pay deposit only', 'your-theme' );
});

// Change submit button text
add_filter( 'bbc_form_submit_button_text', function( $text ) {
    return __( 'Confirm booking', 'your-theme' );
});

// Change accept terms text
add_filter( 'bbc_form_accept_terms_text', function( $text ) {
    return __( 'I confirm I have read the booking', 'your-theme' );
});

// Change accept terms link text
add_filter( 'bbc_form_accept_terms_link_text', function( $text ) {
    return __( 'Rules', 'your-theme' );
});

// Change "Include in price" text for additional services
add_filter( 'bbc_additional_service_include_in_price_text', function( $text ) {
    return __( 'Included in total', 'your-theme' );
});

// Change currency symbol
add_filter( 'bbc_get_currency_symbol', function( $symbol ) {
    $lang = pll_current_language();
    
    $currencies = [
        'af' => 'R',
        'sq' => 'L',
        'ar' => '﷼',
        'hy' => '֏',
        'az' => '₼',
        'eu' => '€',
        'be' => 'Br',
        'bs' => 'KM',
        'bg' => 'лв',
        'ca' => '€',
        'zh' => '¥',
        'hr' => '€',
        'cs' => 'Kč',
        'da' => 'kr',
        'nl' => '€',
        'en' => '$',
        'et' => '€',
        'fi' => '€',
        'fr' => '€',
        'ka' => '₾',
        'de' => '€',
        'el' => '€',
        'he' => '₪',
        'hi' => '₹',
        'hu' => 'Ft',
        'is' => 'kr',
        'id' => 'Rp',
        'it' => '€',
        'ja' => '¥',
        'kk' => '₸',
        'ko' => '₩',
        'lv' => '€',
        'lt' => '€',
        'mk' => 'ден',
        'ms' => 'RM',
        'mt' => '€',
        'nb' => 'kr',
        'fa' => '﷼',
        'pl' => 'zł',
        'pt' => '€',
        'ro' => 'lei',
        'ru' => '₽',
        'sr' => 'din',
        'sk' => '€',
        'sl' => '€',
        'es' => '€',
        'sv' => 'kr',
        'th' => '฿',
        'tr' => '₺',
        'ua' => '₴',
        'ur' => '₨',
        'uz' => 'so'm',
        'vi' => '₫',
    ];
    
    return $currencies[$lang] ?? $symbol;
});
Востаннє змінено: 10.08.2026