Skip to content
WXP Plugins

Plugins

WXP Restaurant Menu

WXP Opening Times

WXP Local Events

WXP Restaurant Reservations

Demo

Pricing

Support

Docs

FAQ

Buy

Menu

Plugins

- WXP Restaurant Menu

- WXP Opening Times

- WXP Local Events

- WXP Restaurant Reservations

Demo

Pricing

Support

- Docs

- FAQ

Buy

WXP Opening Times

8
  • Installation
    • Installing WXP Opening Times
  • Basic operations
    • Creating your (first) schedule
    • Setting exceptions
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Opening Times shortcodes
  • Jewish and Islamic holidays
    • Installation
      • Installing WXP Opening Times: Jewish and Islamic holidays
    • For developers
      • Jewish and Islamic holidays: for developers

WXP Restaurant Menu

7
  • Installation
    • Installing WXP Restaurant Menu
  • Basic operations
    • Understanding the concept
    • The Settings for the WXP Restaurant Menu Plugin
    • The Icon menu
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Restaurant Menu shortcodes

WXP Local Events

8
  • Installation
    • Installing WXP Local Events
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Local Events shortcodes
  • Local Events for WooCommerce
    • Installation
      • Installing WXP Local Events for WooCommerce
    • For developers
      • Local Events for WooCommerce: for developers
  • Events Feed
    • Installation
      • Installing WXP Events Feed
    • For developers
      • Events Feed: for developers

WXP Restaurant Reservations

6
  • Installation
    • Installing WXP Restaurant Reservations
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Restaurant Reservations shortcodes
  • Rooms
    • Installation
      • Installing WXP Restaurant Bookings: Rooms
    • For developers
      • Rooms: for developers

General Developer Information

1
  • Twig
    • Twig templates in the WXP plugins

WXP Agency Kit

1
  • WXP Agency Kit: demo content from the command line
View Categories
  • Home
  • Documentation
  • WXP Local Events
  • For developers
  • Filter- and action hooks

Filter- and action hooks

12 min read

0:00 / 14:30
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)

WXP Local Events offers filters to change the event pages, the reservations and who may manage them, the mails, the structured data, the templates and the editor of the event description. Payment add-ons use the payment hooks. All names start with wxp_local_events_.

How to use a hook #

A filter receives a value, can change it and must return it. An action tells you that something happened, and returns nothing. Add your code to the functions.php of your child theme, or to a small plugin of your own. The last number of add_filter() and add_action() is the number of arguments your function receives; ask for as many as you need.

add_filter( 'hook_name', function ( $value, $extra ) {
	// Change $value here.
	return $value;
}, 10, 2 );

add_action( 'hook_name', function ( $first, $second ) {
	// React here.
}, 10, 2 );

Overview #

Hook Type What it does
wxp_local_events_reservation_created Action Fires after a reservation was made.
wxp_local_events_reservation_status_changed Action Fires after the status of a reservation changed. A rejected reservation has reject_reason and reject_message in its row.
wxp_local_events_reservation_paid Action Fires after the payment of a reservation arrived. A payment add-on reports a payment with ReservationService::mark_paid().
wxp_local_events_reservation_paid_late Action Fires when the payment arrives after the reservation was cancelled or rejected. The seats were released already, so the venue has to decide: refund, or bring the reservation back.
wxp_local_events_mail_enabled Filter Decides whether a mail is sent.
wxp_local_events_mail_message Filter Changes the message before it is sent.
wxp_local_events_mail_sent Action Fires after a mail was handed to wp_mail().
wxp_local_events_manage_reservations_cap Filter Changes the capability needed to see and handle reservations. They hold personal data, so by default only editors and above can.
wxp_local_events_client_id Filter Changes the identifier used for the rate limit of the public reservation form. Behind a proxy, return the address of the real visitor.
wxp_local_events_form_user Filter Changes the values the reservation form is prefilled with for a logged in user.
wxp_local_events_csv_delimiter Filter Changes the delimiter of the CSV export of reservations. The default is a semicolon for the languages whose Excel expects it, and a comma otherwise.
wxp_local_events_date_flags Filter Changes the warnings of a date of an event, such as a holiday or a closed day.
wxp_local_events_payment_methods Filter Registers online payment methods that can be chosen for a paid event.
wxp_local_events_payment_url Filter Gives the address where the guest pays a new reservation of an event that is paid online. The payment add-on answers this filter.
wxp_local_events_order_url Filter Gives the link to the order of a reservation that was paid online. It is shown with the reservation. The payment add-on sets it.
wxp_local_events_currency_source Filter Names the plugin that decides the currency, such as WooCommerce. The currency fields on the settings page are then read-only.
wxp_local_events_currency_symbol Filter Changes the currency symbol shown with event prices.
wxp_local_events_currency_code Filter Changes the ISO 4217 currency code, used in the structured data and on the settings page.
wxp_local_events_demo_event_created Action Fires after the importer has created a demo event with all its fields, so that a payment add-on can set up what the event needs, such as a ticket product.
wxp_local_events_slug Filter Changes the first part of the address of the event pages. Save the permalinks again after you change it.
wxp_local_events_single_layout Filter Changes the layout of the page of an event.
wxp_local_events_single_content Filter Decides whether the plugin adds its details and reservation form to the page of an event. Return false if your theme template prints them itself.
wxp_local_events_single_extra Filter Adds extra details to the page of an event. They reach the template as acf.
wxp_local_events_elementor_frame Filter Decides whether the page of an event is printed with the Elementor header and footer chosen in the settings.
wxp_local_events_feed_items Filter Changes the dates in the public event feed, which other websites can read.
wxp_local_events_json_ld Filter Decides whether the structured data of an event is printed. Return false if an SEO plugin already prints it.
wxp_local_events_json_ld_place Filter Changes the place of the events: a schema.org Place. By default the name and address of the settings are used, and the site name when those are empty.
wxp_local_events_json_ld_data Filter Changes the structured data of an event.
wxp_local_events_template_context Filter Changes the data passed to a template.
wxp_local_events_template_paths Filter Changes the folders where templates are looked for, in lookup order. The folders of your (child) theme come before the templates folder of the plugin.
wxp_local_events_twig_cache Filter Sets a folder for the compiled templates. Caching is off by default.
wxp_local_events_load_css Filter Decides whether the plugin loads its own stylesheet. Return false to use your own CSS.
wxp_local_events_allowed_blocks Filter Changes the blocks that can be used in the description of an event. Blocks of other plugins are not loaded on this screen: register a custom block with a script (see the next hook) and add its name here.
wxp_local_events_editor_script_handles Filter Adds script handles that must load before the admin app, such as the script that registers a custom block.
wxp_local_events_enqueue_editor_assets Action Fires on the events admin screen, so your custom blocks can enqueue their editor scripts. Add the block names with wxp_local_events_allowed_blocks.
wxp_local_events_default_start_time Filter Changes the start time a new event date starts with in the editor.

Actions: reservations #

wxp_local_events_reservation_created #

Action. Fires after a reservation was made.

Argument Type Description
$id int The reservation id.
$reservation array The stored row.
add_action( 'wxp_local_events_reservation_created', function ( int $id, array $reservation ) {
	// Tell your own system about the new reservation.
}, 10, 2 );

wxp_local_events_reservation_status_changed #

Action. Fires after the status of a reservation changed. A rejected reservation has reject_reason and reject_message in its row.

Argument Type Description
$id int The reservation id.
$old string The old status.
$status string The new status.
$row array The stored row.
$actor string admin or guest.

wxp_local_events_reservation_paid #

Action. Fires after the payment of a reservation arrived. A payment add-on reports a payment with ReservationService::mark_paid().

Argument Type Description
$id int The reservation id.
$row array The stored row.

wxp_local_events_reservation_paid_late #

Action. Fires when the payment arrives after the reservation was cancelled or rejected. The seats were released already, so the venue has to decide: refund, or bring the reservation back.

Argument Type Description
$id int The reservation id.
$row array The stored row.

Mail #

wxp_local_events_mail_enabled #

Filter. Decides whether a mail is sent.

Argument Type Description
$send bool true by default.
$type string The mail type.
$row array The reservation.

Return: true to send, false to skip.

wxp_local_events_mail_message #

Filter. Changes the message before it is sent.

Argument Type Description
$message array to, subject, body (HTML) and headers.
$type string The mail type.
$row array The reservation.

Return: the message.

wxp_local_events_mail_sent #

Action. Fires after a mail was handed to wp_mail().

Argument Type Description
$type string The mail type.
$row array The reservation.
$sent bool Whether wp_mail() accepted the mail.

Reservations: access and protection #

wxp_local_events_manage_reservations_cap #

Filter. Changes the capability needed to see and handle reservations. They hold personal data, so by default only editors and above can.

Argument Type Description
$capability string edit_others_posts by default.

Return: a capability.

add_filter( 'wxp_local_events_manage_reservations_cap', function () {
	return 'manage_options';
} );

wxp_local_events_client_id #

Filter. Changes the identifier used for the rate limit of the public reservation form. Behind a proxy, return the address of the real visitor.

Argument Type Description
$ip string The remote address.

Return: the address.

wxp_local_events_form_user #

Filter. Changes the values the reservation form is prefilled with for a logged in user.

Argument Type Description
$values array first_name, last_name and email. Empty for visitors.

Return: the values.

wxp_local_events_csv_delimiter #

Filter. Changes the delimiter of the CSV export of reservations. The default is a semicolon for the languages whose Excel expects it, and a comma otherwise.

Argument Type Description
$delimiter string The delimiter.

Return: the delimiter.

wxp_local_events_date_flags #

Filter. Changes the warnings of a date of an event, such as a holiday or a closed day.

Argument Type Description
$flags array A list of warnings, each with type and label.
$start DateTimeImmutable The start of the date.

Return: the list of warnings.

Payment add-ons #

wxp_local_events_payment_methods #

Filter. Registers online payment methods that can be chosen for a paid event.

Argument Type Description
$methods array Slug => array with label (shown in the editor) and pay_text (shown to guests). Empty by default.

Return: the methods.

add_filter( 'wxp_local_events_payment_methods', function ( array $methods ) {
	$methods['my-gateway'] = array(
		'label'    => 'My gateway',
		'pay_text' => 'You pay online after you reserve.',
	);
	return $methods;
} );

wxp_local_events_payment_url #

Filter. Gives the address where the guest pays a new reservation of an event that is paid online. The payment add-on answers this filter.

Argument Type Description
$url string The payment address. Empty when the add-on cannot take the payment, which cancels the reservation.
$id int The reservation id.
$reservation array The stored row.

Return: the payment address.

wxp_local_events_order_url #

Filter. Gives the link to the order of a reservation that was paid online. It is shown with the reservation. The payment add-on sets it.

Argument Type Description
$url string The link, empty by default.
$order_id int The order.

Return: the link.

wxp_local_events_currency_source #

Filter. Names the plugin that decides the currency, such as WooCommerce. The currency fields on the settings page are then read-only.

Argument Type Description
$source string The name, empty by default.

Return: the name.

wxp_local_events_currency_symbol #

Filter. Changes the currency symbol shown with event prices.

Argument Type Description
$symbol string The symbol; the euro sign unless set in the settings.

Return: the symbol.

wxp_local_events_currency_code #

Filter. Changes the ISO 4217 currency code, used in the structured data and on the settings page.

Argument Type Description
$code string The code; EUR unless set in the settings.

Return: the code.

wxp_local_events_demo_event_created #

Action. Fires after the importer has created a demo event with all its fields, so that a payment add-on can set up what the event needs, such as a ticket product.

Argument Type Description
$event_id int The event.

Event pages #

wxp_local_events_slug #

Filter. Changes the first part of the address of the event pages. Save the permalinks again after you change it.

Argument Type Description
$slug string events by default, without slashes.

Return: the slug.

add_filter( 'wxp_local_events_slug', function () {
	return 'agenda';
} );

wxp_local_events_single_layout #

Filter. Changes the layout of the page of an event.

Argument Type Description
$layout string standard, picture, card or compact.
$event_id int The event.

Return: the layout.

wxp_local_events_single_content #

Filter. Decides whether the plugin adds its details and reservation form to the page of an event. Return false if your theme template prints them itself.

Argument Type Description
$enabled bool true by default.

Return: true or false.

wxp_local_events_single_extra #

Filter. Adds extra details to the page of an event. They reach the template as acf.

Argument Type Description
$extra array Empty by default.
$event_id int The event.

Return: the extra details.

wxp_local_events_elementor_frame #

Filter. Decides whether the page of an event is printed with the Elementor header and footer chosen in the settings.

Argument Type Description
$enabled bool true by default.

Return: true or false.

wxp_local_events_feed_items #

Filter. Changes the dates in the public event feed, which other websites can read.

Argument Type Description
$items array The dates, as listed in the response.

Return: the dates.

Structured data (schema.org) #

wxp_local_events_json_ld #

Filter. Decides whether the structured data of an event is printed. Return false if an SEO plugin already prints it.

Argument Type Description
$enabled bool true by default.

Return: true or false.

add_filter( 'wxp_local_events_json_ld', '__return_false' );

wxp_local_events_json_ld_place #

Filter. Changes the place of the events: a schema.org Place. By default the name and address of the settings are used, and the site name when those are empty.

Argument Type Description
$place array The Place data.

Return: the place.

wxp_local_events_json_ld_data #

Filter. Changes the structured data of an event.

Argument Type Description
$data array The data.
$event_id int The event.

Return: the data.

Templates and stylesheet #

wxp_local_events_template_context #

Filter. Changes the data passed to a template.

Argument Type Description
$context array The template data.
$template string The name of the template.

Return: the template data.

wxp_local_events_template_paths #

Filter. Changes the folders where templates are looked for, in lookup order. The folders of your (child) theme come before the templates folder of the plugin.

Argument Type Description
$paths string[] Folders.

Return: the list of folders.

wxp_local_events_twig_cache #

Filter. Sets a folder for the compiled templates. Caching is off by default.

Argument Type Description
$cache string|false A folder, or false (default).

Return: a folder, or false.

wxp_local_events_load_css #

Filter. Decides whether the plugin loads its own stylesheet. Return false to use your own CSS.

Argument Type Description
$load bool true by default.

Return: true or false.

add_filter( 'wxp_local_events_load_css', '__return_false' );

Editor of the event description #

wxp_local_events_allowed_blocks #

Filter. Changes the blocks that can be used in the description of an event. Blocks of other plugins are not loaded on this screen: register a custom block with a script (see the next hook) and add its name here.

Argument Type Description
$blocks string[] Block names.

Return: the block names.

wxp_local_events_editor_script_handles #

Filter. Adds script handles that must load before the admin app, such as the script that registers a custom block.

Argument Type Description
$handles string[] Script handles, none by default.

Return: the handles.

wxp_local_events_enqueue_editor_assets #

Action. Fires on the events admin screen, so your custom blocks can enqueue their editor scripts. Add the block names with wxp_local_events_allowed_blocks.

wxp_local_events_default_start_time #

Filter. Changes the start time a new event date starts with in the editor.

Argument Type Description
$time string 20:00 by default.

Return: a time, hours and minutes.

Good to know #

  • Rows: the reservation hooks pass the stored row as an array, not as an object.
  • Events Feed: the companion plugin WXP Events Feed reads the public feed that wxp_local_events_feed_items changes.
  • Personal data: reservations hold names and e-mail addresses. Be careful with what you send to other systems from these actions.
Updated on October 30, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
WXP Local Events shortcodesTwig templates

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Table of Contents
  • How to use a hook
  • Overview
  • Actions: reservations
    • wxp_local_events_reservation_created
    • wxp_local_events_reservation_status_changed
    • wxp_local_events_reservation_paid
    • wxp_local_events_reservation_paid_late
  • Mail
    • wxp_local_events_mail_enabled
    • wxp_local_events_mail_message
    • wxp_local_events_mail_sent
  • Reservations: access and protection
    • wxp_local_events_manage_reservations_cap
    • wxp_local_events_client_id
    • wxp_local_events_form_user
    • wxp_local_events_csv_delimiter
    • wxp_local_events_date_flags
  • Payment add-ons
    • wxp_local_events_payment_methods
    • wxp_local_events_payment_url
    • wxp_local_events_order_url
    • wxp_local_events_currency_source
    • wxp_local_events_currency_symbol
    • wxp_local_events_currency_code
    • wxp_local_events_demo_event_created
  • Event pages
    • wxp_local_events_slug
    • wxp_local_events_single_layout
    • wxp_local_events_single_content
    • wxp_local_events_single_extra
    • wxp_local_events_elementor_frame
    • wxp_local_events_feed_items
  • Structured data (schema.org)
    • wxp_local_events_json_ld
    • wxp_local_events_json_ld_place
    • wxp_local_events_json_ld_data
  • Templates and stylesheet
    • wxp_local_events_template_context
    • wxp_local_events_template_paths
    • wxp_local_events_twig_cache
    • wxp_local_events_load_css
  • Editor of the event description
    • wxp_local_events_allowed_blocks
    • wxp_local_events_editor_script_handles
    • wxp_local_events_enqueue_editor_assets
    • wxp_local_events_default_start_time
  • Good to know
WXP Plugins

Demo

Pricing

© 2026 WXP Plugins. All prices are in euro, excluding VAT.

WXPPlugins is a brand of WP Digital Marketing - The Netherlands - Chamber of Commerce (KvK) 75580152