Hooks

Shared

19 hooks fired by Shared: 15 filters and 4 actions across 19 call sites.

19 hooks fired by Shared: 15 filters and 4 actions across 19 call sites. 14 of the 19 call sites are described by a docblock, at the call or on the constant that names the hook; the rest are listed with their signature and call sites only. Paths are relative to the plugin directory.

{$this->module->getId()}_settings_page

Action · Dynamic name · 0 arguments · 1 call site

Fires when one XPAC settings screen is loaded, before its assets are enqueued.

The variable part of the name is the settings module's id, so this is the place to do work that should only happen on that screen — xpac_settings_page for the shared Integrations screen, xpac_forms_settings_page for Forms Settings.

It runs on load-{$hook}, which is early enough to add an admin_enqueue_scripts listener of your own and have it fire on this request.

do_action( "{$this->module->getId()}_settings_page" )

Fired from:

  • packages/Shared/Settings/MenuPage.php:233

{$this->module->getId()}_settings_script_dependencies

Filter · Dynamic name · 1 argument · 1 call site

Filters the extra script handles a settings screen enqueues.

The style-dependencies filter's counterpart, named the same way and with the same rules. These merge ahead of the dependencies the screen's own index.asset.php declares, so a handle listed here loads first.

apply_filters( "{$this->module->getId()}_settings_script_dependencies", [] )
  • $handles (string[]) — Script handles to add. Default empty array.

Fired from:

  • packages/Shared/Settings/MenuPage.php:164

{$this->module->getId()}_settings_style_dependencies

Filter · Dynamic name · 1 argument · 1 call site

Filters the extra stylesheet handles a settings screen enqueues.

The variable part of the name is the settings module's id, so the hook addresses one screen: xpac_settings_style_dependencies for the shared Integrations screen, xpac_forms_settings_style_dependencies for Forms Settings.

The return is merged ahead of the screen's own dependencies, which are always wp-components. A non-array return is discarded silently, and duplicates are removed, so returning a handle that is already there is harmless.

apply_filters( "{$this->module->getId()}_settings_style_dependencies", [] )
  • $handles (string[]) — Style handles to add. Default empty array.

Fired from:

  • packages/Shared/Settings/MenuPage.php:150

wp_react_settings_after_module_settings_save

Action · 3 arguments · 1 call site

Fires after a settings module has written its values.

update_option() has already run for every changed value, so this is the place for work that has to follow a settings change — flushing rewrite rules, clearing a cache, re-scheduling a cron event. There is no way to refuse the save from here; it has happened.

$values is only what the request submitted. $options is the module's full set after the merge, which is what to read when a decision depends on a setting the request did not touch.

do_action( 'wp_react_settings_after_module_settings_save', $this->id, $values, $this->options )
  • $moduleId (string) — Id of the settings module that saved, such as xpac or xpac_forms.
  • $values (array) — The values this request submitted.
  • $options (array) — The module's complete options after the save.

Fired from:

  • packages/Shared/Settings/Settings.php:1088

wp_react_settings_field_types_with_callable_options

Filter · 1 argument · 1 call site

Filters which settings field types may declare their options as a callable rather than a fixed array.

A field type on this list is allowed to set options to a callable, which the settings screen invokes when it builds the field — how the account-backed pickers in the Forms integrations fetch their lists at render time instead of at registration.

select and combobox are always included and cannot be removed. The result is resolved once per request and cached in a static, so a listener added after the first settings field is built has no effect.

apply_filters( 'wp_react_settings_field_types_with_callable_options', [] )
  • $types (string[]) — Additional field types. Default empty array.

Fired from:

  • packages/Shared/Settings/Helper.php:26

xpac_account_url

Filter · 1 argument · 1 call site

apply_filters( 'xpac_account_url', 'https://xpac.io/account/' )

Fired from:

  • packages/Shared/Licensing/Endpoint.php:32

xpac_admin_menu_order

Filter · 1 argument · 1 call site

Filters the rank of each page under the XPAC admin menu root.

A map of page slug to integer rank, sorted ascending. A page whose slug is not in the map takes rank 70 and keeps its registration order relative to its equally-ranked peers, so adding one page does not require listing every other. Return the whole map, not just your addition — a non-array return is discarded and the shipped map used instead.

The first page after sorting is what the menu root itself links to, so rank a real screen above a settings form.

apply_filters( 'xpac_admin_menu_order', self::ORDER )
  • $order (array<string, int>) — Page slug to rank.

Fired from:

  • packages/Shared/Admin/MenuRoot.php:245

xpac_api_base

Filter · 1 argument · 1 call site

apply_filters( 'xpac_api_base', self::BASE )

Fired from:

  • packages/Shared/Licensing/Endpoint.php:21

xpac_brand_icon

Filter · 1 argument · 1 call site

Filters the icon of the top-level admin menu.

Passed straight to add_menu_page(), so it takes anything that argument takes: a dashicons-* name, a data URI holding an SVG, or none to leave the icon to CSS. Default dashicons-screenoptions.

apply_filters( 'xpac_brand_icon', $icon )
  • $icon (string) — Resolved menu icon.

Fired from:

  • packages/Shared/Admin/Brand.php:131

xpac_brand_name

Filter · 1 argument · 1 call site

Filters the label of the single top-level admin menu every XPAC plugin hangs off.

The label only. The menu's URL comes from xpac_brand_slug, and nothing else in the admin reads this value.

It arrives already resolved: the XPAC_BRAND constant if wp-config.php defines one, otherwise the name baked in when the plugin was built, otherwise "XPAC". Filter it when the name has to be decided at runtime — per site on a network, say. To pin a client site to one name, define the constant instead, because a site running several XPAC plugins loads only one copy of this class and the constant is the only layer that does not depend on which copy won.

apply_filters( 'xpac_brand_name', $name )
  • $name (string) — Resolved menu label.

Fired from:

  • packages/Shared/Admin/Brand.php:81

xpac_brand_slug

Filter · 1 argument · 1 call site

Filters the slug of the top-level admin menu.

This reaches admin URLs, the parent_slug of every add_submenu_page() call and the screen ids built from them, so changing it moves every XPAC admin page and invalidates any bookmark or hard-coded link to one.

The return is passed through sanitize_key(), and a value that sanitises to an empty string falls back to xpac rather than producing a menu nothing can attach to.

apply_filters( 'xpac_brand_slug', $slug )
  • $slug (string) — Resolved menu slug, before sanitisation.

Fired from:

  • packages/Shared/Admin/Brand.php:108

xpac_forms_trusted_proxies

Filter · 1 argument · 1 call site

Filters the public networks whose X-Forwarded-For entries are proxy hops.

Read only when the site trusts proxy headers. An entry inside one of these ranges is passed over when the visitor's address is read from X-Forwarded-For. Private and reserved addresses always are.

apply_filters( 'xpac_forms_trusted_proxies', self::CLOUDFLARE_RANGES )
  • $ranges (string[]) — CIDR ranges or single addresses. Default Cloudflare's published edge ranges.

Fired from:

  • packages/Shared/Http/ClientIp.php:134

xpac_license_telemetry

Filter · 1 argument · 1 call site

The one telemetry filter in the suite.

Reduce it to key and url and the licence check still works: the check is contractual and never switched off here.

apply_filters( 'xpac_license_telemetry', $payload )
  • $payload (array<string,mixed>) — What the site is about to send.

Fired from:

  • packages/Shared/Licensing/Telemetry.php:93

xpac_manifest_url

Filter · 1 argument · 1 call site

apply_filters( 'xpac_manifest_url', self::URL )

Fired from:

  • packages/Shared/Licensing/Manifest.php:78

xpac_migration_failed

Action · 3 arguments · 1 call site

A migration step could not run, so nothing was stamped.

Table::refuse() announces the one failure it knows about on xpac_table_sync_failed before throwing; without this every other way a step can fail is invisible outside the PHP error log.

do_action( 'xpac_migration_failed', $migration, $error, $this->versionOption )
  • $migration (string) — The migration class that threw.
  • $error (\Throwable) — What it threw.
  • $option (string) — The version option that was not stamped.

Fired from:

  • packages/Shared/Database/MigrationRunner.php:140

xpac_pricing_url

Filter · 1 argument · 1 call site

apply_filters( 'xpac_pricing_url', self::PRICING_URL )

Fired from:

  • packages/Shared/Extensions/Extensions.php:469

xpac_pro_feature

Filter · 2 arguments · 1 call site

Narrow which paid features are available on this site.

ANDed with the licence, never substituted for it: this can turn an available feature off, but can never turn an unlicensed site into a licensed one.

apply_filters( self::FILTER, true, $feature )
  • $allowed (bool) — Whether nothing has vetoed this feature yet.
  • $feature (string) — The feature being asked about.

Fired from:

  • packages/Shared/Licensing/Gate.php:64

xpac_table_sync_failed

Action · 3 arguments · 1 call site

A declared column or index could not be added to a live table.

do_action( 'xpac_table_sync_failed', $sql, $error, static::getTableName() )
  • $sql (string) — The statement that failed.
  • $error (string) — What the server said, if anything.
  • $table (string) — The table being synced.

Fired from:

  • packages/Shared/Database/Table.php:451

xpac_trust_proxy_headers

Filter · 1 argument · 1 call site

apply_filters( 'xpac_trust_proxy_headers', false )

Fired from:

  • packages/Shared/Http/ClientIp.php:83

On this page