1. Home
  2. Knowledge Base
  3. Bookings for WooCommerce
  4. Actions and Filters
  1. Home
  2. Knowledge Base
  3. Developer
  4. Actions and Filters

Actions and Filters

Here is a list of available hooks for Bookings for WooCommerce.

Filters


bfwc_calendar_page_capability

Controls the capability required to access the admin bookings calendar page.

Arguments

  • $capability (string, default 'manage_options')

bfwc_user_nicename

Filters the display name shown for a user on the admin calendar.

Arguments

  • $user_nicename (string)

bfwc_export_page_capability

Controls the capability required to access the bookings export page.

Arguments

  • $capability (string, default 'manage_options')

bfwc_external_page_capability

Controls the capability required to access the external calendar (iCal) page.

Arguments

  • $capability (string, default 'manage_options')

bfwc_events_from_interval

Sets the time interval used when pulling events from an external iCal feed.

Arguments

  • $interval (string, default '1 year')

bfwc_gcal_capability

Controls the capability required to access Google Calendar settings.

Arguments

  • $capability (string, default 'manage_options')

bfwc_disable_tax_adjustment_create_order

Prevents tax adjustment when creating an order from the admin booking form.

Arguments

  • $disable (bool, default false)
  • $product (WC_Product)

bfwc_show_regenerate_slots_button

Controls visibility of the “Regenerate Slots” button on the product edit screen.

Arguments

  • $show (bool, default true)

bfwc_edit_text

Filters the “Edit” link text shown in the booking calendar.

Arguments

  • $text (string, default 'Edit')

bfwc_no_availability_text

Filters the “no availability data” text shown in the booking calendar.

Arguments

  • $text (string, default 'No availability data')

bfwc_bookings_text

Filters the “Bookings” label in the booking calendar.

Arguments

  • $text (string, default 'Bookings')

bfwc_no_bookings_text

Filters the “No bookings” label in the booking calendar.

Arguments

  • $text (string, default 'No bookings')

bfwc_product_text

Filters the “Product” label in the booking calendar.

Arguments

  • $text (string, default 'Product')

bfwc_enable_all_dates_non_standard_costs

When true, enables all dates to use non-standard (custom pricing) costs even when outside normal rules.

Arguments

  • $enabled (bool, default false)
  • $product_id (int)

bfwc_menu_position

Sets the admin menu position for the Bookings menu item.

Arguments

  • $position (int, default 58)

bfwc_multiple_bookings_per_order

When true, allows multiple booking products in a single order.

Arguments

  • $allow (bool, default false)

bfwc_booking_reference

Filters the booking reference string shown on the order.

Arguments

  • $reference (string, e.g. '#123')
  • $booking_id (int)

bfwc_filter_settings

Filters the full array of plugin settings before they are rendered in WooCommerce settings.

Arguments

  • $settings (array)

bfwc_settings_sections

Filters the settings sections array in the plugin settings tab.

Arguments

  • $sections (array)

bfwc_get_availability_per_day

Filters the availability data array returned for a product on a per-day basis.

Arguments

  • $availability (array)
  • $product_id (int)

bfwc_pewc_child_product_not_available

Filters the error message shown when a PEWC child product is unavailable on the selected dates.

Arguments

  • $message (string)

bfwc_pewc_child_product_max_booking

Filters the error message shown when a PEWC child product cannot accommodate the selected quantity.

Arguments

  • $message (string)

bfwc_rental_bundle_unavailable_text

Filters the error message shown when a rental bundle is unavailable for the selected dates.

Arguments

  • $message (string)

bfwc_discount_rates

Filters the discount tiers data before it is applied to the booking cost calculation.

Arguments

  • $discounts (array)
  • $product_id (int)

bfwc_booking_cost

Filters the calculated booking cost before the full return JSON is assembled.

Arguments

  • $booking_cost (float)
  • $product_id (int)

bfwc_booking_cost_return_json

Filters the complete AJAX response array returned by the cost calculation. Primary hook for modifying the final cost, dates, duration, and availability shown to the customer.

Arguments

  • $return_json (array: post_id, num_units, cost, dates, nonstd, end, duration, discounted_amount, lowest_availability)
  • $return_values (array, raw calculated values)
  • $posted (array, original POST data)

bfwc_filter_booking_not_permitted

Filters the error message shown when server-side date validation rejects a booking.

Arguments

  • $message (string)

bfwc_booking_title_start_date

Filters the formatted start date string used in the booking post title.

Arguments

  • $start_date (string)

bfwc_booking_title_end_date

Filters the formatted end date string used in the booking post title.

Arguments

  • $end_date (string)

bfwc_date_formatter_pattern

Filters the ICU date pattern used to format month names in the datepicker calendar.

Arguments

  • $pattern (string, default 'MMMM')

bfwc_block_disabled_days

When true, disabled days of the week are treated as fully blocked rather than just unselectable.

Arguments

  • $block (bool, default false)
  • $product_id (int)

bfwc_language

Filters the locale string passed to the datepicker (e.g. 'en').

Arguments

  • $lang (string)

bfwc_postpone_start

Filters the number of days from today before the earliest selectable start date.

Arguments

  • $postpone_start (int|string)
  • $product_id (int)

bfwc_standard_price

Filters the standard (per-unit) booking cost for a product.

Arguments

  • $cost (float)
  • $product_id (int)

bfwc_get_unavailable_dates

Filters the array of unavailable dates for a product.

Arguments

  • $unavailable_dates (array)
  • $product_id (int)

bfwc_filter_validation_fail_booking_exists

Filters the error message shown when a booking for those dates already exists.

Arguments

  • $message (string)

bfwc_filter_booking_cost_add_cart_item

Filters the booking cost at the point it is set on the cart item (affects what WooCommerce charges).

Arguments

  • $cost (float)
  • $cart_item (array)

bfwc_filter_added_to_cart_message

Filters the notice shown after a booking is successfully added to the cart.

Arguments

  • $message (string)

bfwc_allow_zero_cost_bookings

When true, allows bookings with a zero cost to proceed to cart without being blocked.

Arguments

  • $allow (bool)
  • $product_id (int)

bfwc_filter_validation_fail_parameters

Filters the error message shown when required booking parameters are missing on add-to-cart.

Arguments

  • $message (string)

bfwc_filter_validation_fail_no_slot

Filters the error message shown when no time slot is selected for a slot-based product.

Arguments

  • $message (string)

bfwc_filter_validation_fail_slot_unavailable

Filters the error message shown when a selected time slot is already taken.

Arguments

  • $message (string)

bfwc_filter_validation_fail_slot_past

Filters the error message shown when a selected time slot is in the past.

Arguments

  • $message (string)

bfwc_filter_validation_fail_blocked_date

Filters the error message shown when a selected date is blocked/unavailable.

Arguments

  • $message (string)

bfwc_filter_custom_meta_cart_labels_for

Filters the labels used for booking metadata displayed in the cart (start date, end date, quantity, slot times).

Arguments

  • $labels (array: start_date_text, end_date_text, num_bookings, slot_start_time, slot_end_time)

bfwc_filter_validation_fail_more_than_1_bookings

Filters the supplementary message shown when extra booking products are removed from the cart.

Arguments

  • $message (string)

bfwc_max_bookings_in_cart

Filters the maximum number of booking products allowed in the cart simultaneously.

Arguments

  • $max (int, minimum 1)

bfwc_filter_calculated_booking_cost

Filters the raw calculated cost value read from the hidden calculated_booking_cost POST field on add-to-cart. Runs before cart validation.

Arguments

  • $cost (string/float)
  • $posted (array, full $_POST)

bfwc_default_num_bookings

Filters the default quantity (number of bookings) pre-filled in the quantity input.

Arguments

  • $default (int, default 1)
  • $product_id (int)

bfwc_discount_type

Filters the discount type ('percentage', 'fixed', or 'per_unit') for a product.

Arguments

  • $discount_type (string)
  • $product_id (int)

bfwc_allow_overlaps

When true, allows multiple bookings to overlap on the same dates.

Arguments

  • $allow (bool)
  • $product_id (int)

bfwc_is_overlappable

Filters whether a booking product can accept overlapping bookings.

Arguments

  • $is_overlappable (bool)
  • $product_id (int)

bfwc_booking_unit

Filters the booking unit type ('day', 'night', 'hour', 'minute', 'slot').

Arguments

  • $unit (string)
  • $product_id (int)

bfwc_auto_set_end

Filters whether the end date is automatically set to match the start date ('yes'/'no').

Arguments

  • $auto (string)
  • $product_id (int)

bfwc_filter_check_in_placeholder

Filters the placeholder label for the check-in / start date input.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_filter_check_out_placeholder

Filters the placeholder label for the check-out / end date input.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_quantity_bookings_text

Filters the label for the quantity/bookings input field.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_filter_duration_label

Filters the duration label shown in the booking form.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_filter_cost_label

Filters the cost label shown in the booking form.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_add_to_cart_text

Filters the add-to-cart button text for booking products.

Arguments

  • $text (string)
  • $product_id (int)

bfwc_data_in_cells

When true, shows availability data inside calendar day cells rather than in a tooltip.

Arguments

  • $show (bool, default false)
  • $product_id (int)

bfwc_available_label

Filters the “Available” label shown in the datepicker legend.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_select_start_time_label

Filters the “Select start time” label in the time slot picker.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_select_end_time_label

Filters the “Select end time” label in the time slot picker.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_select_duration_label

Filters the “Select duration” label in the time slot picker.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_unavailable_label

Filters the “Unavailable” label shown in the datepicker legend.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_minute_label

Filters the singular “minute” time unit label.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_minutes_label

Filters the plural “minutes” time unit label.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_hour_label

Filters the singular “hour” time unit label.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_hours_label

Filters the plural “hours” time unit label.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_whole_day_label

Filters the “whole day” duration label for slot products.

Arguments

  • $label (string)
  • $product_id (int)

bfwc_discount_rate_max

Filters the maximum allowed discount rate value (used to cap input in the admin UI).

Arguments

  • $max (int, default 9999)
  • $product_id (int)

bfwc_disabled_days

Filters the array of disabled days of the week (0=Sunday … 6=Saturday).

Arguments

  • $disabled_days (array)
  • $product_id (int)

bfwc_filter_is_flat_rate

Filters whether a product uses flat-rate pricing.

Arguments

  • $is_flat_rate (bool)
  • $product_id (int)

bfwc_pewc_one_only_entire_booking

When true, PEWC “one only” fields apply across the entire booking rather than per unit.

Arguments

  • $one_only (bool, default true)

bfwc_step_per_product

Filters the quantity input step value on the product page.

Arguments

  • $step (int, default 1)
  • $product_id (int)

bfwc_min_bookings_per_product

Filters the minimum quantity selectable on the product page.

Arguments

  • $min (int, default 1)
  • $product_id (int)

bfwc_max_bookings_per_product

Filters the maximum quantity selectable on the product page (per transaction, not total availability).

Arguments

  • $max (int)
  • $product_id (int)

bfws_filter_pricing_table_heading

Filters the heading of the pricing table shown on the product page.

Arguments

  • $heading (string, default 'Pricing Details')

bfws_filter_pricing_table_unit

Filters the “Per day / night / hour” column heading in the pricing table.

Arguments

  • $text (string)
  • $label (array, unit labels)

bfws_filter_pricing_table_standard

Filters the “Standard Cost” column heading in the pricing table.

Arguments

  • $text (string, default 'Standard Cost')

bfwc_flat_rate_price_label

Filters the “per booking” suffix appended to the flat-rate price on the product page.

Arguments

  • $label (string, default 'per booking')
  • $product (WC_Product)

bfwc_filter_unit_labels

Filters the full unit labels array (singular/plural) for the booking unit type.

Arguments

  • $labels (array: single, plural)
  • $product_id (int)

bfwc_slot_availability_child_driven

When true, a slot product’s availability is determined by its child products rather than its own stock.

Arguments

  • $child_driven (bool, default true)
  • $product_id (int)

bfwc_get_slot_day_availability

Filters the availability data returned for a product on a specific day (slot products).

Arguments

  • $availability (array)
  • $product_id (int)

bfwc_filter_metabox_fields

Filters the array of fields registered for the booking metabox on the order screen.

Arguments

  • $fields (array)

bfwc_filter_metaboxes

Filters the array of booking metaboxes registered on the order screen.

Arguments

  • $metaboxes (array)

bfwc_search_submit_classes

Filters the CSS classes applied to the booking search form submit button.

Arguments

  • $classes (array, default ['button'])

bfwc_search_submit_text

Filters the label of the booking search form submit button.

Arguments

  • $text (string, default 'Search')

bfwc_after_add_to_cart_button

When false, suppresses the WooCommerce woocommerce_after_add_to_cart_button action in the booking template.

Arguments

  • $show (bool, default true)

bfwc_filter_validation_fail_booking_product_already_exists

Filters the error message shown when the cart already contains a booking and bfwc_max_bookings_in_cart is exceeded.

Arguments

  • $message (string)

Actions


bfwc_trigger_before_booking_starts_email

Fired when the scheduled “before booking starts” email cron runs for a booking.

Arguments

  • $booking_id (int)
  • $date (string)

bfwc_trigger_before_booking_ends_email

Fired when the scheduled “before booking ends” email cron runs for a booking.

Arguments

  • $booking_id (int)
  • $date (string)

bfwc_trigger_after_booking_ends_email

Fired when the scheduled “after booking ends” email cron runs for a booking.

Arguments

  • $booking_id (int)
  • $date (string)

bfwc_after_booking_ends_email_after_content

Fired after the body content in the “after booking ends” email template — add extra content here.

Arguments

  • $email (WC_Email)

bfwc_after_booking_starts_email_after_content

Fired after the body content in the “after booking starts” email template.

Arguments

  • $email (WC_Email)

bfwc_before_booking_ends_email_after_content

Fired after the body content in the “before booking ends” email template.

Arguments

  • $email (WC_Email)

bfwc_before_booking_starts_email_after_content

Fired after the body content in the “before booking starts” email template.

Arguments

  • $email (WC_Email)

bfwc_after_create_new_booking

Fired immediately after a new booking post is created (triggered from both the AJAX handler and the CPT class).

Arguments

  • $booking_id (int)
  • $status (string)
  • $booking_meta (array)
  • $product_id (int)

bfwc_booking_edited

Fired after a booking is edited and saved from the admin booking edit screen.

Arguments

  • $booking_id (int)

bfwc_after_cancel_edit

Fired when the admin booking edit is cancelled.

Arguments

  • $booking_id (int)

bfwc_booking_form_{$view}

Dynamic action fired inside the booking form template; $view is the current form view slug. Hook here to inject content into the booking form.

Arguments

  • None

bfwc_start_set_booking_processing

Fired at the start of the order-processing routine that transitions bookings to “processing” status.

Arguments

  • None

Was this article helpful?