Bookings: Action and Filter reference

Actions and filters listed on this page are specific to WooCommerce Bookings.

Actions

ACTION ARGS DESCRIPTION
wc_bookings_updated   Fires after a new plugin version is installed.
woocommerce_admin_booking_data_after_booking_details Int: Booking ID Fires after customer select box when viewing/editing a booking in admin.
woocommerce_admin_process_booking_object Obj: Booking object Fires after data is processed when saving booking through admin, but before data is saved to the database.
woocommerce_after_add_to_cart_button   Fires after the add-to-cart button in the single product add-to-cart template.
woocommerce_after_add_to_cart_form   Fires after the booking form in the single product add-to-cart template.
woocommerce_before_add_to_cart_button   Fires before the add-to-cart button in the single product add-to-cart template.
woocommerce_before_booking_form   Fires before the booking form in the single product add-to-cart template.
woocommerce_before_booking_object_save Obj: Booking object, Obj: Data store Fires just before saving to the database, allows for adjusting object properties before save.
woocommerce_booking_{ status } Int: Booking ID, Obj: Booking object Fires when a booking is changed to { status }.
woocommerce_booking_{ status_from }_to_{ status_to } Int: Booking ID, Obj: Booking object Fires when a booking is changed from { status_from } to { status_to }.
woocommerce_booking_process_meta Int: Booking ID Fires after data is processed when saving booking through admin, and after data has been saved to the database.
woocommerce_bookings_after_booking_base_cost Int: Product ID Fires after base cost of product in admin.
woocommerce_bookings_after_booking_block_cost Int: Product ID Fires after block cost of product in admin.
woocommerce_bookings_after_booking_pricing_base_cost Arr: Pricing for product, Int: Product ID Fires after base cost modifier in pricing rules for product in admin. Remains in table cell.
woocommerce_bookings_after_booking_pricing_cost Arr: Pricing for product, Int: Product ID Fires after block cost modifier in pricing rules for product in admin. Remains in table cell.
woocommerce_bookings_after_bookings_pricing Int: Product ID Fired after pricing rules are rendered for product in admin. Outside of table body.
woocommerce_bookings_after_create_booking_page   Fires after options, but before Next button when creating a booking through admin. Remains in table.
woocommerce_bookings_after_display_cost Int: Product ID Fires after display cost of product in admin.
woocommerce_bookings_after_person_block_cost Int: Person type ID Fires after the person type block cost is output in admin. Remains in table cell.
woocommerce_bookings_after_person_block_cost_column Int: Person type ID Fires after the person type costs are output in admin. Remains in table row.
woocommerce_bookings_after_person_cost Int: Person type ID Fires after the person type base cost is output in admin. Remains in table cell.
woocommerce_bookings_after_person_max_column Int: Person type ID Fires after the person type min/max fields in admin. Remains in table row.
woocommerce_bookings_after_resource_block_cost Int: Resource ID, Int: Product ID Fires after product’s resource block cost is output in admin. Remains in table cell.
woocommerce_bookings_after_resource_cost Int: Resource ID, Int: Product ID Fires after product’s resource base cost is output in admin. Remains in table cell.
woocommerce_bookings_before_delete_global_availability   Fires before a global availability entry is deleted.
woocommerce_bookings_cancelled_booking Int: Booking ID Fires after a booking is cancelled.
woocommerce_bookings_create_booking_page_add_order_item Int: Order ID Fires after order is created when manually creating a booking with an order through the admin.
woocommerce_bookings_pricing_fields Arr: Pricing for product Fired after pricing rules are rendered for product in admin. Remains in table body.
woocommerce_delete_booking Int: Booking ID Fires when a booking is deleted/removed from trash.
woocommerce_new_booking Int: Booking ID Fires when a booking is created and added to the database. Such as when a booking is added to cart.
woocommerce_trash_booking Int: Booking ID Fires when a booking is moved to the trash.
woocommerce_bookings_update_google_client Google_Client: Google API Client Object Fires before any Google API request is made so a custom client ID and secret can be set.

Filters

FILTER PASSED ARGS DESCRIPTION
woocommerce_bookings_calculated_booking_cost Int: Booking Cost Obj: Product, Arr: Posted data Allows booking cost modification before return from calculate_booking_cost(), which returns the calculated cost of a booking.
booking_form_fields Arr: Field Arrays   Can be used to edit the fields (duration, persons, resources, date) that are used on the booking form.
booking_form_params Arr: Parameter strings (translated)   Strings that are used for JavaScript notices to the user when using the calendar.
bookings_cancel_booking_url Str: URL to cancel   Allows modification of the cancellation URL for a customer to cancel their booking.
get_booking_products_args Arr: get_posts args   Used in get_bookable_product_ids which uses get_posts to query all bookable products.
get_booking_resources_args Arr: get_posts args   Used in get_bookable_product_resource_ids which uses get_posts to query all bookable resources.
wc_bookings_calendar_default_to_current_date Bool: true   By default the calendar will default to ‘today’. If false is returned, calendar will default to first available booking date.
wc_bookings_get_time_slots_html Str: HTML time blocks Arr: Available blocks, Arr: Blocks Filters the returned HTML of `wc_bookings_get_time_slots_html`.
wc_bookings_summary_list_date Str: Booking date Int: Starting timestamp, Int: Ending timestamp Can be used to format the date in the bookings summary for orders and emails.
woocommerce_admin_bookable_resource_actions Arr: Actions Obj: Resource Actions shown in the admin list view.
woocommerce_admin_booking_actions Arr: Actions Obj: Booking Actions shown in admin list view.
woocommerce_booking_cancelled_notice Str: “Your booking was cancelled.” (translated) Str: Notice Type Message is displayed when user cancels their booking through My Account.
woocommerce_booking_form_get_posted_data Arr: Mixed data Obj: Product, Int: Duration Length All of the data posted to the Booking Form in a processed clean array.
woocommerce_booking_get_availability_rules Arr: Array of availability rules Int: Resource rules apply to, Obj: Bookable product The availability rules configured for a particular resource ID, if resource is 0, then for the product itself.
woocommerce_booking_has_status Bool Obj: Booking, Str: Status Used when checking if a booking has a set status.
woocommerce_booking_is_booked_on_day Bool Obj: Booking, Int: Start timestamp, Int: End timestamp Filter the booking object’s is_booked_on_day method return result.
woocommerce_booking_json_search_order_number Str: Search term   The order number being searched for when editing a booking.
woocommerce_booking_requires_confirmation Bool Obj: Bookable product Whether the bookable product is set to require confirmation or not.
woocommerce_booking_single_add_to_cart_text Str: “Book Now” (translated)   Allows updates to add to cart button.
woocommerce_booking_single_check_availability_text Str: “Check Availability” (translated)   Allows updates to add to cart button when booking requires confirmation.
woocommerce_booking_user_can_cancel Bool Obj: Bookable product Whether the bookable product allows customer cancellations or not.
woocommerce_bookings_account_endpoint Str: “bookings”   Default endpoint for bookings in the My Account page.
woocommerce_bookings_account_tables Arr: Arrays of user’s bookings   Tabular data being passed to the `myaccount/bookings.php` template to display a user’s bookings.
woocommerce_bookings_booked_day_blocks Arr: Array of booked blocks Obj: Bookable product Array of days that are fully or partially booked being returned to the calendar for display.
woocommerce_bookings_booking_cost_string Str: “Booking cost” (translated) Obj: Product Text shown before the price when customer chooses date/time on the calendar.
woocommerce_bookings_data_labels Arr: Array of strings (translated)   Labels used for bookings in places such as the cart.
woocommerce_bookings_date_format Str: Date format from wc_date_format()   Allows to change date format for everything Bookings.
woocommerce_bookings_date_picker_end_label Str: “End” (translated)   End label on a product’s calendar.
woocommerce_bookings_date_picker_start_label Str: “Start” (translated)   Start label on a product’s calendar.
woocommerce_bookings_email_actions Arr: Actions   Array of actions used for triggering emails.
woocommerce_bookings_emails_ics Arr: Email IDs   Email IDs to attach ics (calendar) files to.
woocommerce_bookings_for_user_statuses Arr: Array of statuses   Array of statuses as `status => Status Name` (translated), used for statuses for bookings that are displayed in My Account > Bookings.
woocommerce_bookings_fully_booked_statuses Arr: Array of statuses   Array of statuses as `status => Status Name` (translated), used for statuses for bookings that block off time on the calendar.
woocommerce_bookings_get_duration_unit Str: Duration unit Obj: Bookable product The duration unit set for the bookable product.
woocommerce_bookings_get_end_date_with_time Str: Date/time string Obj: Booking Passes formatted date/time string passed through date_i18n().
woocommerce_bookings_get_person_types_ids Arr: get_posts args   Used in get_person_types_ids which uses get_posts to query all bookable persons.
woocommerce_bookings_get_start_date_with_time Str: Date/time string Obj: Booking Passes formatted date/time string passed through date_i18n().
woocommerce_bookings_in_date_range_query Arr: Booking IDs   Booking IDs being returned after a date range query.
woocommerce_bookings_max_date_unit Str Int: ID of Bookable product The unit/amount used for max date that a bookable product can be booked into the future.
woocommerce_bookings_max_date_value Int Int: ID of Bookable product The numeric value for max date that a bookable product can be booked into the future.
woocommerce_bookings_mdy_format Bool: true   If switched to `false`, date format in calendar will be dd/mm/yyyy, else it’s mm/dd/yyyy.
woocommerce_bookings_min_date_unit Str Int: ID of Bookable product The unit/amount used for min date that a bookable product can be booked into the future.
woocommerce_bookings_min_date_value Int Int: ID of Bookable product The numeric value for min date that a bookable product can be booked into the future.
woocommerce_bookings_override_form_default_date null Obj: Booking Form Return value should be valid unix timestamp, which will default the calendar to the date specified.
woocommerce_bookings_process_cost_rules_base_cost Float|Str: Base Cost set in product Cost rules Arr: Fields for rule, Str: Key/ID for rule The base cost set for a cost rule under a product.
woocommerce_bookings_process_cost_rules_cost Float|Str: Block Cost set in product Cost rules Arr: Fields for rule, Str: Key/ID for rule The block cost set for a cost rule under a product.
woocommerce_bookings_process_cost_rules_override_block Bool Arr: Fields for rule, Str: Key/ID for rule Deprecated
woocommerce_bookings_product_types Arr   Single element array is passed. Used for testing if a product is a bookable product.
woocommerce_bookings_remind_before_days Int: 1   Provides ability to increase the amount of days before a booking that a reminder email is sent.
woocommerce_bookings_remove_inactive_cart_time Int: 60   Bookings are created when added to cart and are scheduled for deletion in 60 minutes if not purchased. Value can be changed to increase/decrease schedule.
woocommerce_bookings_resource_additional_cost_string Str: Additional cost Obj: Resource Resource select boxes in the calendar contain additional cost if there is any, allows editing of the additional cost string.
woocommerce_bookings_scheduled_statuses Arr: Array of statuses   Array of statuses as `status => Status Name` (translated), used to determine if the booking should have events scheduled, such as reminder emails.
woocommerce_bookings_time_format Str: return of wc_time_format()   Allows to change time format for everything Bookings.
woocommerce_email_attachments Arr: Attachments to emails Str: The ID of the email, Obj: The email object WooCommerce core filter for email attachments.
woocommerce_email_heading_{ email_id } Str: Email heading Obj: Email object WooCommerce core filter for email headings.
woocommerce_email_subject_{ email_id } Str: Email subject Obj: Email object WooCommerce core filter for email subjects.
woocommerce_my_account_bookings_title Str: “My Bookings” (translated)   Page title for My Account > Bookings. (deprecated)
woocommerce_new_booking_data Arr: Data for new post   Used when creating a new booking, if defaults needed to be changed.
woocommerce_new_product_data Arr: Data for new post   Used when creating a new bookable product, if defaults needed to be changed.
woocommerce_register_post_type_bookable_person Arr: Data for new post type   Arguments passed when creating the `bookable_person` custom post type.
woocommerce_register_post_type_bookable_resource Arr: Data for new post type   Arguments passed when creating the `bookable_resource` custom post type.
woocommerce_register_post_type_wc_booking Arr: Data for new post type   Arguments passed when creating the `wc_booking` custom post type.
woocommerce_valid_booking_statuses_for_cancel Arr: Array of statuses   Array of statuses as `status => Status Name` (translated), used to determine if a booking is in a status that can be cancelled.
woocommerce_bookings_calculated_booking_cost_success_output Str: Output string   Provides the ability to modify the string being shown to the user for the cost (useful for low inventory or fee structure type outputs)
woocommerce_bookings_my_bookings_past_order_by Str: Order by field for past bookings query.   Allows modification of past bookings list order for My Account > Bookings view.
woocommerce_bookings_my_bookings_past_query_args Arr: filters for past Bookings query.   Allows modification of query for bookings displayed for past on My Account > Bookings view.
woocommerce_bookings_my_bookings_today_order_by Str: Order by field for today bookings query.   Allows modification of today’s bookings list order for My Account > Bookings view.
woocommerce_bookings_my_bookings_today_query_args
Arr: filters for today’s bookings query.
  Allows modification of query for bookings displayed for today on My Account > Bookings view.
woocommerce_bookings_my_bookings_upcoming_order_by Str: Order by field for upcoming bookings query.   Allows modification of upcoming bookings list order for My Account > Bookings view.
woocommerce_bookings_my_bookings_upcoming_query_args Arr: filters for upcoming bookings query.   Allows modification of query for bookings displayed for upcoming on My Account > Bookings view.
Was this article helpful?
Dislike 0
Views: 10