Модуль Auth
Личный кабинет клиента (Customer Panel) есть в тарифах Pro и Elite. В тарифах Free и Starter его нет. Регистрация клиентов при бронировании доступна начиная с тарифа Starter. См. таблицу тарифов.
Обзор
Baza Booking Calendar Auth является полнофункциональным модулем аутентификации для WordPress, обеспечивающий лаконичную и удобную систему управления учетными записями.
Он включает в себя вход в систему, регистрацию и личный кабинет с отдельными разделами для управления профилем, бронирований и функций программы лояльности.
Модуль полностью соответствует стандартам WordPress и может быть настроен с помощью фильтров и действий.
Структура URL-адреса
При активации плагин «Baza Booking Calendar Auth» автоматически создает лаконичные и понятные URL-адреса:
- /account/: главная страница учетной записи
- /account/login/: форма входа
- /account/register/: форма регистрации
- /account/lostpassword/: страница для восстановления пароля
- /account/resetpass/: страница сброса пароля
- /account/dashboard/: личный кабинет пользователя
- /account/dashboard/bookings/: мои бронирования
- /account/dashboard/loyalty/: программа лояльности
- /account/dashboard/profile/: настройки профиля
Такая структура обеспечивает единообразную навигацию для пользователей и способствует оптимизации сайта для поисковых систем.
Основные функции
Baza Booking Calendar Auth предоставляет все необходимые функции для управления учетными записями:
- Безопасная регистрация пользователей с проверкой данных и уведомлениями по электронной почте
- Вход и выход из системы с использованием встроенной системы аутентификации WordPress
- Пользовательская панель управления с несколькими вкладками и гибкой навигацией
- Редактирование профиля (имя, адрес электронной почты, номер телефона и т. д.)
- Смена пароля с проверкой в режиме реального времени
- Удаление учетной записи с подтверждением пароля
- Перезапись URL-адресов





Баланс аккаунта
Баланс учётной записи включается в разделе «Общие настройки» переключателем «Включить баланс пользователя», который активирует пополнение, списание с баланса и начисление бонусов для зарегистрированных пользователей.
После включения администратор может настроить минимальную сумму пополнения, срок действия баланса (в днях), минимальную сумму оплаты с баланса и процент бонуса при пополнении.
Пользователи пополняют баланс через текущий активный платёжный шлюз прямо во вкладке Баланс. После пополнения баланс можно использовать для оплаты бронирования вместо повторного прохождения через платёжный шлюз.
Каждое пополнение и списание фиксируется в истории транзакций с указанием даты, действия и суммы.
После включения вкладка Баланс становится доступной по адресу /account/dashboard/balance/ рядом с остальными вкладками аккаунта (Бронирования, Программа лояльности, Настройки профиля).
Шорткоды
Модуль поддерживает шорткоды для удобного встраивания. Вы также можете настраивать надписи полей формы и подсказки с помощью параметров шорткодов, например:
[baza_booking_calendar_auth] - displays login and registration forms
[baza_booking_calendar_auth show_welcome="false"] - Disable welcome
[baza_booking_calendar_balance]: outputs the formatted balance, e.g. $150.00
[baza_booking_calendar_balance format="raw"]: just the number 150.00
[baza_booking_calendar_dashboard] - displays the user dashboard
[baza_booking_calendar_dashboard default_tab="profile"] - opens a specific dashboard tab by default
[baza_booking_calendar_auth
redirect="/account/dashboard/"
show_welcome="true"
welcome_text="Welcome Back!"
dashboard_button_text="Go to Dashboard"
login_title="Sign In"
register_title="Create Account"
forgot_password_text="Forgot Password?"
no_account_text="Don't have an account? Register"
have_account_text="Already have an account? Login"
registration_success_text="Registration successful! You can now login."
login_button_text="Sign In"
register_button_text="Sign Up"
username_label="Username or Email"
password_label="Password"
email_label="Email"
confirm_password_label="Confirm Password"
first_name_label="First Name"
last_name_label="Last Name"
remember_me_label="Remember Me"
username_placeholder="Enter your username"
email_placeholder="Enter your email address"
password_placeholder="Enter your password"
first_name_placeholder="Enter your first name"
last_name_placeholder="Enter your last name"
]Все доступные фильтры (хуки)
Форма входа:
- baza_bc_before_login_form: перед всей формой входа в систему
- baza_bc_before_login_form_fields: Перед полями формы
- baza_bc_after_login_form_fields: После полей формы
- baza_bc_after_login_form: После всей формы входа
Регистрационная форма:
- baza_bc_before_register_form: перед всей формой регистрации
- baza_bc_register_form_start: начало формы (после открывающего тега)
- baza_bc_register_form_after_username: После поля «Имя пользователя»
- baza_bc_register_form_after_email: После поля электронной почты
- baza_bc_register_form_after_password: После поля для ввода пароля
- baza_bc_register_form_after_password_confirm: После подтверждения пароля
- baza_bc_register_form_after_first_name: После имени
- baza_bc_register_form_after_last_name: После фамилии
- baza_bc_register_form_before_submit: Перед нажатием кнопки «Отправить»
- baza_bc_register_form_after_submit: После нажатия кнопки «Отправить»
- baza_bc_after_register_form: После заполнения всей регистрационной формы
Форма восстановления забытого пароля:
- baza_bc_before_lostpassword_form: Перед запуском формы восстановления пароля
- baza_bc_before_lostpassword_form_fields: Перед полями формы
- baza_bc_lostpassword_form_before_submit: Перед нажатием кнопки «Отправить»
- baza_bc_lostpassword_form_after_submit: После нажатия кнопки «Отправить»
- baza_bc_after_lostpassword_form_fields: После полей формы
- baza_bc_after_lostpassword_form: После заполнения всей формы восстановления пароля
Форма сброса пароля:
- baza_bc_before_resetpass_form: перед запуском всей формы сброса пароля
- baza_bc_before_resetpass_form_fields: перед полями формы
- baza_bc_resetpass_form_before_submit: Перед нажатием кнопки «Отправить»
- baza_bc_resetpass_form_after_submit: После нажатия кнопки «Отправить»
- baza_bc_after_resetpass_form_fields: После полей формы
- baza_bc_after_resetpass_form: После заполнения всей формы сброса пароля
<?php
/**
* FILTERS
*/
// Modify dashboard tabs
add_filter( 'baza_bc_dashboard_tabs', function( $tabs, $current_tab ) {
$tabs['custom'] = array(
'title' => __( 'Custom Tab', 'textdomain' ),
'url' => home_url( '/account/dashboard/custom/' ),
'order' => 15
);
unset( $tabs['loyalty'] );
return $tabs;
}, 10, 2 );
// Render custom tab content
// Use together with baza_bc_dashboard_tabs to add full custom tab
add_filter( 'baza_bc_dashboard_render_tab', function( $content, $tab ) {
if ( $tab !== 'custom' ) return $content;
ob_start();
?>
<div class="bbc-custom-tab">
<h3><?php _e( 'Custom Tab', 'textdomain' ); ?></h3>
<p>Your custom content here.</p>
</div>
<?php
return ob_get_clean();
}, 10, 2 );
// Number of items per page (default: 10)
add_filter( 'baza_bc_account_bookings_per_page', function( $per_page ) {
return 20;
});
// Bookings data before sorting
add_filter( 'baza_bc_account_bookings_before_sort', function( $bookings ) {
return $bookings;
});
// Bookings data after sorting
add_filter( 'baza_bc_account_bookings_after_sort', function( $bookings, $orderby, $order ) {
return $bookings;
}, 10, 3 );
// Show/hide table count
add_filter( 'baza_bc_account_bookings_show_table_count', '__return_false' );
// Show/hide pagination
add_filter( 'baza_bc_account_bookings_show_pagination', '__return_false' );
// Show/hide entire table
add_filter( 'baza_bc_account_bookings_show_table', '__return_false' );
// Show/hide empty bookings message
add_filter( 'baza_bc_account_bookings_show_empty_message', '__return_false' );
// Pagination arguments
add_filter( 'baza_bc_account_bookings_pagination_args', function( $args ) {
return $args;
});
/**
* ACTIONS
*/
// Before content
add_action( 'baza_bc_dashboard_before_content', function( $user, $tab ) {
echo '<div class="content-header">Current tab: ' . $tab . '</div>';
}, 10, 2 );
// After content
add_action( 'baza_bc_dashboard_after_content', function( $user, $tab ) {
echo '<div class="content-footer">Need help? Contact support</div>';
}, 10, 2 );
// Before title
add_action( 'baza_bc_account_bookings_before_title', function() {
echo '<div class="custom-alert">Special announcement</div>';
});
// After title
add_action( 'baza_bc_account_bookings_after_title', function() {
echo '<p class="subtitle">Manage your bookings below</p>';
});
// Before controls (where sorting would go)
add_action( 'baza_bc_account_bookings_before_controls', function() {
echo '<div class="custom-filters">Custom filters here</div>';
});
// Inside table nav on the right side
add_action( 'baza_bc_account_bookings_table_nav_right', function( $orderby, $order, $per_page ) {
?>
<div class="bbc-table-sort">
<label for="bbc-sort"><?php _e( 'Sort:', 'baza-booking-calendar' ); ?></label>
<select id="bbc-sort" class="bbc-sort-select">
<option value="date-desc" <?php selected( $orderby === 'date' && $order === 'desc' ); ?>>
<?php _e( 'Newest First', 'baza-booking-calendar' ); ?>
</option>
<option value="date-asc" <?php selected( $orderby === 'date' && $order === 'asc' ); ?>>
<?php _e( 'Oldest First', 'baza-booking-calendar' ); ?>
</option>
<option value="price-desc" <?php selected( $orderby === 'price' && $order === 'desc' ); ?>>
<?php _e( 'Price: High to Low', 'baza-booking-calendar' ); ?>
</option>
<option value="price-asc" <?php selected( $orderby === 'price' && $order === 'asc' ); ?>>
<?php _e( 'Price: Low to High', 'baza-booking-calendar' ); ?>
</option>
</select>
</div>
<?php
}, 10, 3 );
// After controls
add_action( 'baza_bc_account_bookings_after_controls', function( $orderby, $order, $per_page ) {
echo '<div class="custom-notice">Current sort: ' . $orderby . '</div>';
}, 10, 3 );
// Before table
add_action( 'baza_bc_account_bookings_before_table', function( $bookings ) {
echo '<div class="table-info">Showing ' . count( $bookings ) . ' bookings</div>';
});
// Before each row
add_action( 'baza_bc_account_bookings_before_row', function( $booking ) {
// Add custom class or markup before row
});
// After each row
add_action( 'baza_bc_account_bookings_after_row', function( $booking ) {
// Add expandable details row
echo '<tr class="booking-details"><td colspan="5">Details for ' . $booking['order_id'] . '</td></tr>';
});
// After table
add_action( 'baza_bc_account_bookings_after_table', function( $bookings ) {
echo '<div class="table-summary">Total bookings: ' . count( $bookings ) . '</div>';
});
// Before pagination
add_action( 'baza_bc_account_bookings_before_pagination', function( $paged, $total_pages ) {
echo '<div class="pagination-info">Page ' . $paged . ' of ' . $total_pages . '</div>';
}, 10, 2 );
// After pagination
add_action( 'baza_bc_account_bookings_after_pagination', function( $paged, $total_pages ) {
echo '<a href="#top" class="back-to-top">Back to top</a>';
}, 10, 2 );
// After all content
add_action( 'baza_bc_account_bookings_after_content', function() {
echo '<div class="booking-help">Need help? Contact support</div>';
});
/**
* ACTIONS LOGIN AND REGISTER FORM
*/
/**
* LOGIN FORM HOOKS
*/
// Add content before login form
add_action( 'baza_bc_before_login_form', function( $atts ) {
echo '<div class="login-notice">Welcome back!</div>';
});
// Add content before form fields
add_action( 'baza_bc_before_login_form_fields', function( $atts ) {
echo '<p class="login-info">Please enter your credentials</p>';
});
// Add content after form fields
add_action( 'baza_bc_after_login_form_fields', function( $atts ) {
echo '<div class="social-login"><button>Login with Google</button></div>';
});
// Add content after login form
add_action( 'baza_bc_after_login_form', function( $atts ) {
echo '<p class="help-text">Need help? <a href="/support">Contact support</a></p>';
});
/**
* REGISTRATION FORM HOOKS
*/
// Add content before registration form
add_action( 'baza_bc_before_register_form', function( $atts ) {
echo '<div class="register-benefits">Join us and get 10% off!</div>';
});
// Add content after form opens
add_action( 'baza_bc_register_form_start', function( $atts ) {
echo '<p class="form-intro">Fill in all required fields</p>';
});
// Add phone field after email
add_action( 'baza_bc_register_form_after_email', function( $atts ) {
?>
<div class="form-row">
<label for="phone">Phone *</label>
<input type="tel" name="phone" id="phone" class="regular-text" placeholder="+44" required />
</div>
<?php
});
// Add hint after username
add_action( 'baza_bc_register_form_after_username', function( $atts ) {
echo '<small class="field-hint">Username cannot be changed later</small>';
});
// Add hint after password
add_action( 'baza_bc_register_form_after_password', function( $atts ) {
echo '<small class="field-hint">Password must be at least 8 characters</small>';
});
// Add hint after password confirm
add_action( 'baza_bc_register_form_after_password_confirm', function( $atts ) {
echo '<small class="field-hint">Passwords must match</small>';
});
// Add hint after first name
add_action( 'baza_bc_register_form_after_first_name', function( $atts ) {
echo '<small class="field-hint">Optional but recommended</small>';
});
// Add custom field after last name
add_action( 'baza_bc_register_form_after_last_name', function( $atts ) {
?>
<div class="form-row">
<label for="company">Company</label>
<input type="text" name="company" id="company" class="regular-text" placeholder="Your company name" />
</div>
<?php
});
// Add terms checkbox before submit button
add_action( 'baza_bc_register_form_before_submit', function( $atts ) {
?>
<div class="form-row">
<label>
<input type="checkbox" name="terms" required />
I agree to <a href="/terms">Terms and Conditions</a>
</label>
</div>
<?php
});
// Add content after submit button
add_action( 'baza_bc_register_form_after_submit', function( $atts ) {
echo '<p class="privacy-notice">Your data is protected by our privacy policy</p>';
});
// Add content after registration form
add_action( 'baza_bc_after_register_form', function( $atts ) {
echo '<div class="social-register"><button>Register with Facebook</button></div>';
});
/**
* TEXTS, REDIRECTS, SWITCHES
*/
// Text of the button of [baza_booking_calendar_auth] for a visitor and for a logged-in user
add_filter( 'baza_bc_auth_login_text', function( $text ) {
return __( 'Sign in', 'textdomain' );
});
add_filter( 'baza_bc_auth_account_text', function( $text ) {
return __( 'Account', 'textdomain' );
});
// Change the attributes of [baza_booking_calendar_auth] for every use
add_filter( 'baza_bc_auth_shortcode_atts', function( $atts ) {
return $atts;
});
// Where to go after logging out (default: home page)
add_filter( 'baza_bc_logout_redirect_url', function( $url ) {
return home_url( '/goodbye/' );
});
// Switch the whole auth module off
add_filter( 'baza_bc_auth_init', '__return_false' );
// Live updates of the bookings table in the account (default follows the calendar setting)
add_filter( 'baza_bc_account_live_updates', '__return_true' );
// How often the table asks for news, in seconds (never less than 5)
add_filter( 'baza_bc_account_live_updates_delay', function( $seconds ) {
return 30;
});
// May the client change a booking? ($can, $post_id, $meta - the booking data, $user_id)
// Default: true for a pending or booked booking that is not locked by its date
add_filter( 'baza_bc_client_can_edit_booking', function( $can, $post_id, $meta, $user_id ) {
return $can;
}, 10, 4 );
// May the client switch a booking to another service? ($can, $post_id, $user_id). Default: true
add_filter( 'baza_bc_client_can_change_service', function( $can, $post_id, $user_id ) {
return $can;
}, 10, 3 );
// May the client change the additional services of a booking? ($can, $post_id, $meta, $user_id)
// Default: true when the service has additional services
add_filter( 'baza_bc_client_can_edit_extras', function( $can, $post_id, $meta, $user_id ) {
return $can;
}, 10, 4 );
/**
* REGISTRATION
* The form creates the account with the WordPress function wp_create_user(), so the core hook user_register runs.
*/
// Save a custom field that was added with baza_bc_register_form_after_email
add_action( 'user_register', function( $user_id ) {
if ( isset( $_POST['phone'] ) ) {
update_user_meta( $user_id, 'phone', sanitize_text_field( wp_unslash( $_POST['phone'] ) ) );
}
});Доступные действия (хуки)
<?php
// Example: put a banner above the content of every dashboard tab
add_action( 'baza_bc_dashboard_before_content', function( $user, $tab ) {
echo '<div class="notice">Hello, ' . esc_html( $user->display_name ) . '</div>';
}, 10, 2 );
// Example: add a tab and render it
add_filter( 'baza_bc_dashboard_tabs', function( $tabs, $current_tab ) {
$tabs['invoices'] = array(
'title' => __( 'Invoices', 'textdomain' ),
'url' => home_url( '/account/dashboard/invoices/' ),
'order' => 15,
);
return $tabs;
}, 10, 2 );
add_filter( 'baza_bc_dashboard_render_tab', function( $content, $tab ) {
return 'invoices' === $tab ? '<p>' . esc_html__( 'No invoices yet.', 'textdomain' ) . '</p>' : $content;
}, 10, 2 );
// Example: show only confirmed bookings, five per page
add_filter( 'baza_bc_account_bookings_per_page', function() { return 5; } );
add_filter( 'baza_bc_account_bookings_before_sort', function( $bookings ) {
return array_filter( $bookings, function( $booking ) {
return in_array( $booking['order_status'], array( 'booked', 'completed' ), true );
});
});
// Example: hide the table count and the pagination
add_filter( 'baza_bc_account_bookings_show_table_count', '__return_false' );
add_filter( 'baza_bc_account_bookings_show_pagination', '__return_false' );
// Example: a short text above the registration form fields and a terms checkbox before the button
add_action( 'baza_bc_register_form_start', function( $atts ) {
echo '<p class="form-intro">' . esc_html__( 'Fill in all required fields.', 'textdomain' ) . '</p>';
});
add_action( 'baza_bc_register_form_before_submit', function( $atts ) {
echo '<label><input type="checkbox" name="terms" required /> ' . esc_html__( 'I agree to the terms', 'textdomain' ) . '</label>';
});Вкладки кабинета
Вкладки по умолчанию: Бронирования (порядок 10), Программа лояльности (20, только когда функция программ лояльности включена), Настройки профиля (30) и Выход (999). Модули Balance, Packages и Referral добавляют собственные вкладки, когда они включены. Чтобы добавить, убрать или переставить вкладки, используйте baza_bc_dashboard_tabs.
