Skip to content

Add filter/action hooks for admin-extensible booking process#12

Open
datengraben wants to merge 3 commits into
masterfrom
claude/add-booking-filter-hooks-ZiS7s
Open

Add filter/action hooks for admin-extensible booking process#12
datengraben wants to merge 3 commits into
masterfrom
claude/add-booking-filter-hooks-ZiS7s

Conversation

@datengraben

Copy link
Copy Markdown
Owner

Introduces eight new WordPress hooks so plugin developers can intercept
and extend the booking flow without patching core files:

Filter hooks

  • commonsbooking_booking_form_fields – inject HTML into the initial booking form (step 1)
  • commonsbooking_booking_confirmation_fields – inject HTML into the confirm/cancel form (step 2)
  • commonsbooking_booking_redirect_url – override the post-creation redirect (enables intermediate pages)
  • commonsbooking_booking_meta_input – filter the meta saved when a new booking is inserted

Action hooks

  • commonsbooking_booking_pre_validate – run custom validation before booking rules; throw BookingDeniedException to block
  • commonsbooking_booking_created – fires after a new unconfirmed booking is created
  • commonsbooking_booking_confirmed – fires after a booking is transitioned to confirmed
  • commonsbooking_save_booking_meta – fires on every booking form submission; persist custom $_REQUEST fields here

Each hook is documented with phpdoc, a since tag, and a usage example.

https://claude.ai/code/session_01XgmCDQJdsHhoRfErjoZKNe

claude added 3 commits April 15, 2026 08:02
Introduces eight new WordPress hooks so plugin developers can intercept
and extend the booking flow without patching core files:

Filter hooks
- commonsbooking_booking_form_fields        – inject HTML into the initial booking form (step 1)
- commonsbooking_booking_confirmation_fields – inject HTML into the confirm/cancel form (step 2)
- commonsbooking_booking_redirect_url        – override the post-creation redirect (enables intermediate pages)
- commonsbooking_booking_meta_input          – filter the meta saved when a new booking is inserted

Action hooks
- commonsbooking_booking_pre_validate  – run custom validation before booking rules; throw BookingDeniedException to block
- commonsbooking_booking_created       – fires after a new unconfirmed booking is created
- commonsbooking_booking_confirmed     – fires after a booking is transitioned to confirmed
- commonsbooking_save_booking_meta     – fires on every booking form submission; persist custom $_REQUEST fields here

Each hook is documented with phpdoc, a since tag, and a usage example.

https://claude.ai/code/session_01XgmCDQJdsHhoRfErjoZKNe
Current release is 2.10.10; new hooks should reference the next version.

https://claude.ai/code/session_01XgmCDQJdsHhoRfErjoZKNe
Adds a dedicated "Booking process hooks (since 2.10.11)" section to both
the English and German hooks-and-filters documentation pages, covering
all 8 new hooks with parameter tables and usage examples:

Filters: commonsbooking_booking_form_fields,
         commonsbooking_booking_confirmation_fields,
         commonsbooking_booking_redirect_url,
         commonsbooking_booking_meta_input

Actions: commonsbooking_booking_pre_validate,
         commonsbooking_booking_created,
         commonsbooking_booking_confirmed,
         commonsbooking_save_booking_meta

Also adds the new hooks to the existing overview lists in both languages.

https://claude.ai/code/session_01XgmCDQJdsHhoRfErjoZKNe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants