Skip to content
delta

Developer hooks

This reference lists the 148 production 21press_delta_* PHP hooks in Delta 0.5.0: 23 actions and 125 filters. It is for developers who extend Delta in a plugin or child theme. Hook names and signatures were checked at the released tag; runtime tests were not run.

Actions run code at a named point. Filters receive a value and return the value Delta uses. In each filter signature, the first argument is the filtered value. Defaults describe the value at the call site; other filters can change it. Register the number of arguments your callback needs.

Actions

Hook and details

21press_delta_init

Arguments: none

Purpose: Runtime init for feature and integration modules.

21press_delta_before_native_content
(new in 0.4.5)

Arguments: WP_Post $post

Purpose: Before native post content is printed.

21press_delta_after_native_content
(new in 0.4.5)

Arguments: WP_Post $post

Purpose: After native post content.

21press_delta_before_header
(new in 0.5.0)

Arguments: none

Purpose: Hook map. Before the header. The hook map actions fire only on a page served to a visitor, not in a preview, wp-admin or the REST API. What a callback prints lands at that spot.

21press_delta_after_header
(new in 0.5.0)

Arguments: none

Purpose: Hook map. After the header.

21press_delta_main_start
(new in 0.5.0)

Arguments: none

Purpose: Hook map. Start of the main area, right after the opening <main> tag.

21press_delta_main_end
(new in 0.5.0)

Arguments: none

Purpose: Hook map. End of the main area, right before </main>.

21press_delta_before_entry_content
(new in 0.5.0)

Arguments: WP_Post $post

Purpose: Hook map. Before the content of the page's own entry, designed in Delta or not. Once per page.

21press_delta_after_entry_content
(new in 0.5.0)

Arguments: WP_Post $post

Purpose: Hook map. After the content of the page's own entry. Once per page.

21press_delta_before_loop
(new in 0.5.0)

Arguments: int $total

Purpose: Hook map. Before the page's own {{#posts}} list. $total is the number of posts. Does not fire for an empty list.

21press_delta_before_loop_item
(new in 0.5.0)

Arguments: WP_Post $item, int $index, int $total

Purpose: Hook map. Before each post in that list. $index starts at 0.

21press_delta_after_loop_item
(new in 0.5.0)

Arguments: WP_Post $item, int $index, int $total

Purpose: Hook map. After each post in that list.

21press_delta_after_loop
(new in 0.5.0)

Arguments: int $total

Purpose: Hook map. After the page's own {{#posts}} list.

21press_delta_before_comments
(new in 0.5.0)

Arguments: WP_Post $post

Purpose: Hook map. Before the comments.

21press_delta_after_comments
(new in 0.5.0)

Arguments: WP_Post $post

Purpose: Hook map. After the comments.

21press_delta_before_footer
(new in 0.5.0)

Arguments: none

Purpose: Hook map. Before the footer.

21press_delta_after_footer
(new in 0.5.0)

Arguments: none

Purpose: Hook map. After the footer.

21press_delta_hook_<name>
(new in 0.5.0)

Arguments: ?WP_Post $post

Purpose: Fires where a design has {{hook:name}}. The name takes lower-case letters, digits, _ and -, up to 64 characters. $post is the entry in scope, or null. Fires on the same requests as the hook map. With nothing hooked it prints nothing.

21press_delta_content_changed
(new in 0.4.8)

Arguments: array $change

Purpose: Fires once per stored change, for cache plugins. $change holds scope (post or site), postIds and source.

21press_delta_dashboard_enqueue
(new in 0.5.0)

Arguments: string $page

Purpose: A Delta dashboard screen is loading. Dashboard extensions enqueue their scripts and styles here. $page is the slug of the screen. A script depends on the handle 21press-delta-dashboard.

21press_delta_after_site_import
(new in 0.5.0)

Arguments: string $why

Purpose: A backup plugin fires it after a full-site import or a roll back. Delta Plugin does. $why is import or rollback. Delta listens and rebuilds its generated component CSS and JS, its component index and the permalink rules.

21press_delta_library_remote

Arguments: string $path

Purpose: Cloud Library remote request.

21press_delta_library_session_request

Arguments: mixed $proof

Purpose: Cloud Library session request.

Filters: entry, templates, render

Hook and details

21press_delta_entry_access
(new in 0.4.5)

Arguments: (?array $decision, WP_Post $post, string $context)

Default: null

Purpose: One access answer for every print path.

21press_delta_entry_access_sources
(new in 0.4.5)

Arguments: (list $sources)

Default: array('password')

Purpose: Names of gates on this site.

21press_delta_entry_content_warnings
(new in 0.4.5)

Arguments: (array $warnings, int $post_id, string $html)

Default: accumulated warnings

Purpose: Extra warnings on a per-entry design write. Write still saved.

21press_delta_entry_write_block
(new in 0.4.5)

Arguments: (?WP_Error $blocked, string $post_type)

Default: null

Purpose: Refuse generic entry writes for a plugin record.

21press_delta_entry_meta_write

Arguments: (?mixed $written, int $post_id, string $raw_key, mixed $clean, array $map)

Default: null

Purpose: Plugin writes a field-map meta key itself.

21press_delta_singular_uses_entry_design

Arguments: (bool $use, int $post_id)

Default: true

Purpose: False: page prints plugin content, not the Delta design.

21press_delta_entry_body
(new in 0.5.0)

Arguments: (string $html, WP_Post $post)

Default: $html

Purpose: Body of the page's own entry when it is designed in Delta, where the_content does not run. Placeholders and shortcodes are resolved. Once per page. A non-string return is ignored.

21press_delta_render_single_product

Arguments: (bool $render)

Default: false

Purpose: Woo single-product.php: true would print an assigned product template; unused branch.

21press_delta_render_product_archive

Arguments: (bool $render)

Default: false

Purpose: archive-product.php: true would print an assigned shop archive; unused branch.

21press_delta_content_probe
(new in 0.4.5)

Arguments: (bool $on, WP_Post $post, string $context)

Default: true

Purpose: Whether to probe the_content for unintegrated gates.

21press_delta_content_probe_replacers
(new in 0.4.5)

Arguments: (array $names)

Default: Content_Probe::REPLACERS

Purpose: Plugin the_content callbacks treated as replacers.

21press_delta_slug_changed_warning

Arguments: ($warning, WP_Post $post, $url_before, $url_after)

Default: built warning

Purpose: Warning when a write changes a public URL.

21press_delta_template_type_registry

Arguments: (array $core)

Default: core types

Purpose: Add template types (WooCommerce and MemberPress).

21press_delta_type_group_labels
(new in 0.4.5)

Arguments: (array $labels)

Default: array('woocommerce' => 'WooCommerce')

Purpose: Group labels in the type picker.

21press_delta_template_content_warnings

Arguments: (array $own, int $id, string $html, string $css, string $type, string $slug)

Default: chrome warnings

Purpose: Extra template write warnings.

21press_delta_template_default_seed

Arguments: (?mixed $extra, string $type)

Default: null

Purpose: Extra seed HTML for a template type.

21press_delta_tie_sample_entries

Arguments: (array $entries)

Default: resolver list

Purpose: Sample entries for template preview.

21press_delta_expand_shortcodes

Arguments: (string $html)

Default: $html

Purpose: Expand shortcodes in design HTML.

21press_delta_expand_html_placeholders

Arguments: (string $html)

Default: $html

Purpose: After HTML placeholder expansion.

21press_delta_render_source

Arguments: (string $html, $part_id)

Default: $html

Purpose: Alternate HTML source for a render.

21press_delta_hierarchy_html

Arguments: (string $html, $content_id, array $context)

Default: $html

Purpose: After hierarchy HTML is built.

21press_delta_hierarchy_preview_post_type

Arguments: (string $post_type, string $type)

Default: $post_type

Purpose: Preview post type for a template type.

21press_delta_chrome_body_placeholders
(new in 0.4.5)

Arguments: (list $names)

Default: content, comments, comment_list, comment_form, comment_pagination, loop_item

Purpose: Names that do not belong in header/footer.

21press_delta_loop_names

Arguments: (list $names)

Default: built-in plus field maps

Purpose: Loop names resolved, including in chrome.

21press_delta_loop_allowed_attrs

Arguments: (array $map)

Default: query/taxonomy/related/has attrs

Purpose: Allowed loop attributes.

21press_delta_loop_items

Arguments: (array $items, string $name, string $arg, array $scope, $attrs)

Default: array()

Purpose: Items for a named loop.

21press_delta_loop_child_scope

Arguments: (array $child, array $parent, string $name, string $arg, $item)

Default: $child

Purpose: Scope inside a loop row.

21press_delta_entry_blocked_loops

Arguments: (list $blocked)

Default: array('posts')

Purpose: Loops left literal in per-entry HTML.

21press_delta_entry_placeholders

Arguments: (array $placeholders, WP_Post $post, array $opts)

Default: empty then filled

Purpose: Per-entry placeholder map.

21press_delta_scope_placeholders

Arguments: (array $placeholders, array $scope, string $chunk)

Default: built map

Purpose: Root/scope placeholder map.

21press_delta_placeholder_docs

Arguments: (array $docs)

Default: built docs

Purpose: Placeholder documentation for agents.

21press_delta_reserved_placeholders

Arguments: (list $names)

Default: reserved names

Purpose: Names field maps may not take.

21press_delta_has_value
(new in 0.4.5)

Arguments: (?bool $has, string $name, array $scope)

Default: null

Purpose: {{#has:name}} truth.

21press_delta_pagination_end_size

Arguments: (int $n)

Default: 1

Purpose: Query pagination end size.

21press_delta_pagination_mid_size

Arguments: (int $n)

Default: 2

Purpose: Query pagination mid size.

21press_delta_related_posts_limit

Arguments: (int $n, WP_Post $post)

Default: 4

Purpose: {{#related}} cap.

21press_delta_read_wpm

Arguments: (int $wpm)

Default: 200

Purpose: Words per minute for read time.

21press_delta_query_denied_types

Arguments: (list $denied, string $type)

Default: long prefix list including wp_, shop_order, form/SEO/MP/LLMS internals, 21press_delta

Purpose: Post types {{#query}} refuses.

21press_delta_query_args
(new in 0.4.8)

Arguments: (array $args, string $type, array $attrs, array $scope)

Default: built WP_Query args

Purpose: Query args of a {{#query}} list, before it runs. A non-array return is ignored.

21press_delta_query_pager_url
(new in 0.4.8)

Arguments: (string $url, string $as, int $num)

Default: built URL

Purpose: Page link of a paginated {{#query}} list. A non-string return is ignored.

21press_delta_description_shortcode_runners
(new in 0.4.8)

Arguments: (array $runners, string $hook)

Default: array('do_shortcode')

Purpose: Callbacks that run shortcodes in an archive description.

21press_delta_language_plugin
(new in 0.4.8)

Arguments: (?string $found)

Default: detected plugin name or null

Purpose: Name of a plugin that owns the document language. Delta then prints no language and no hreflang.

21press_delta_condition_catalog

Arguments: (array $catalog)

Default: built catalog

Purpose: Display condition names.

21press_delta_condition_catalog_by_type

Arguments: (array $by_type)

Default: built map

Purpose: Conditions allowed per template type.

21press_delta_request_flags

Arguments: (array $flags, $override)

Default: built flags

Purpose: Request flags for matching.

21press_delta_condition_matches

Arguments: (bool $match, array $c, array $flags)

Default: false

Purpose: Whether one condition matches.

21press_delta_request_body_slot

Arguments: (string $slot, array $flags)

Default: resolved slot

Purpose: Body template slot for this request.

21press_delta_location_resolve_limit

Arguments: (int $n, string $type)

Default: 500

Purpose: Cap when resolving location conditions.

21press_delta_output_positions
(new in 0.5.0)

Arguments: (list $positions)

Default: array()

Purpose: Places in a Delta page where a plugin can print. Each position has id, label, group, action and needs, the placeholder the design must print for the action to fire. Delta lists the hook map here and WooCommerce lists its own.

21press_delta_soft_nav_hard_response

Arguments: (bool $hard)

Default: false

Purpose: Soft Navigation must load this URL in full.

21press_delta_soft_nav_skip_request

Arguments: (bool $skip)

Default: false

Purpose: Do not print the soft-nav script on this request.

21press_delta_soft_nav_hard_paths

Arguments: (array $paths)

Default: array()

Purpose: Paths that always load in full.

21press_delta_preview_styles_after_base

Arguments: (string $css)

Default: ''

Purpose: Extra CSS after base in previews.

Filters: snapshots, integrations, design context

Hook and details

21press_delta_approval_action
(new in 0.4.5)

Arguments: (?string $summary, string $ability_id, array $input)

Default: null

Purpose: Sentence the owner approves, or null to run.

21press_delta_approval_details
(new in 0.5.0)

Arguments: (string $details, string $ability_id, array $input)

Default: '' or, for a feature switch, the details of that feature

Purpose: Text shown under a request on the Approvals screen. Kept up to 200000 characters. A non-string return shows no text.

21press_delta_snapshot_extras
(new in 0.4.5)

Arguments: (array $extras)

Default: array()

Purpose: Extra snapshot files (key, label, capture, restore). From 0.5.0 an extra is restored as the person or agent who started the restore.

21press_delta_integration_data_providers
(new in 0.4.5)

Arguments: (array $providers)

Default: built registry

Purpose: Add a snapshot data provider.

21press_delta_meta_scope
(new in 0.4.5)

Arguments: (string $scope, string $key, string $type, string $subtype)

Default: 'all'

Purpose: 'none' keeps a meta key out of snapshots.

21press_delta_meta_derived
(new in 0.4.5)

Arguments: (bool $derived, string $key)

Default: false

Purpose: Meta key is derived, do not store.

21press_delta_meta_rows_write
(new in 0.4.5)

Arguments: (bool $written, string $type, int $id, string $subtype, string $key, array $values)

Default: false

Purpose: Plugin writes multi-row meta itself.

21press_delta_post_type_owner
(new in 0.4.5)

Arguments: (string $owner, string $type)

Default: resolved owner or ''

Purpose: Integration that owns a non-public post type.

21press_delta_integration_for_post_type

Arguments: (string $id, string $post_type)

Default: ''

Purpose: Integration id for a post type during collect.

21press_delta_snapshot_auto_spawn

Arguments: (bool $spawn, string $id)

Default: true

Purpose: Whether to spawn cron for a snapshot job.

21press_delta_snapshot_blocked
(new in 0.5.0)

Arguments: (string $reason)

Default: ''

Purpose: A sentence that says why snapshots and restores cannot start now, for a plugin that runs its own site-wide job. An empty string lets them start.

21press_delta_snapshot_tick_budget

Arguments: (float $budget, bool $background)

Default: 10.0 in the background, 3.0 for a poll; at most a third of max_execution_time

Purpose: Seconds one tick of a snapshot job may run steps. 0 runs one step per tick. $background is true for cron and the self-request, false for a poll.

21press_delta_private_paths
(new in 0.5.0)

Arguments: (list $paths)

Default: array()

Purpose: Private folders a backup should skip, as absolute paths without a trailing slash. Delta adds its snapshots and jobs folders. The backup plugin applies this filter. Delta does not apply it itself.

21press_delta_migrations

Arguments: (array $registry)

Default: 0.3.8, 0.4.0, 0.4.2, 0.4.5 paths

Purpose: Migration version => file.

21press_delta_mcp_ability_namespaces

Arguments: (array $namespaces)

Default: array()

Purpose: Plugin ability namespaces listed on MCP. From 0.5.0 a namespace can set groups (key => label, description, ids). Each group has its own tab on the Abilities screen.

21press_delta_ability_switches

Arguments: (array $switches)

Default: array()

Purpose: Foreign ability id => Delta switch id.

21press_delta_context_sources

Arguments: (array $sources)

Default: array()

Purpose: Skill/rule folders.

21press_delta_context_is_visible

Arguments: (bool $visible, string $name, string $kind)

Default: computed

Purpose: Whether a context item is listed.

21press_delta_field_map_origin

Arguments: (string $origin, array $row)

Default: 'manual'

Purpose: How a field map was created.

21press_delta_field_map_orphaned

Arguments: (?mixed $orphaned, array $row)

Default: null

Purpose: Field map no longer has a source.

21press_delta_field_map_value

Arguments: (?mixed $value, WP_Post $post, array $map)

Default: null

Purpose: Override a field-map value.

21press_delta_design_context_contact_forms

Arguments: (array $context)

Default: built when a form plugin is active

Purpose: get-design-context contact-forms block. No filter if none active.

21press_delta_design_context_content_types

Arguments: (array $context)

Default: built when a CPT plugin is active

Purpose: Content-types block. No filter if none active.

21press_delta_design_context_seo

Arguments: (array $context)

Default: built when an SEO provider is active

Purpose: SEO block. No filter if none active.

21press_delta_design_context_woocommerce

Arguments: (array $context)

Default: active false, abilities []

Purpose: Woo block.

21press_delta_design_context_redirection

Arguments: (array $context)

Default: array('active'=>false)

Purpose: Redirection block.

21press_delta_design_context_memberpress
(new in 0.4.5)

Arguments: (array $context)

Default: inactive payload

Purpose: MemberPress block.

21press_delta_design_context_lifterlms
(new in 0.4.5)

Arguments: (array $context)

Default: inactive payload

Purpose: LifterLMS block.

21press_delta_design_context_tutor
(new in 0.4.8)

Arguments: (array $context)

Default: array('active'=>false)

Purpose: Tutor LMS block.

21press_delta_design_context_litespeed
(new in 0.4.8)

Arguments: (array $context)

Default: array('active'=>false)

Purpose: LiteSpeed Cache block.

21press_delta_design_context_search_filter
(new in 0.4.8)

Arguments: (array $context)

Default: array('active'=>false)

Purpose: Search & Filter block.

21press_delta_design_context_static_export

Arguments: (array $context)

Default: inactive payload

Purpose: Simply Static block.

21press_delta_design_context_acss

Arguments: (array $context)

Default: inactive payload

Purpose: Automatic.css block.

Filters: Front panel, library, Coming Soon, design system, MCP

Hook and details

21press_delta_front_panel_enabled

Arguments: (bool $on)

Default: true

Purpose: Whether the Front panel loads.

21press_delta_front_panel_tabs

Arguments: (array $tabs)

Default: array()

Purpose: Extra Front panel tabs.

21press_delta_front_panel_keep_hint

Arguments: (string $hint, $draft, $mode)

Default: ''

Purpose: Draft-keeper hint.

21press_delta_features
(new in 0.5.0)

Arguments: (list $declared)

Default: array()

Purpose: Features a companion plugin adds to the Features page and the feature abilities. Each item is an array that needs id and label. The plugin keeps its own switch and checks.

21press_delta_dashboard_extensions
(new in 0.5.0)

Arguments: (array $extensions)

Default: array()

Purpose: Screens a plugin adds to Delta's dashboard, keyed by extension id. Each value has label, pages and scripts. Page slugs start with 21press-delta-. A page with 'nav' => false keeps its address but stays out of the nav. The screens build on window.p21DeltaDashboardKit, kit version 2.

21press_delta_map_entries_per_type

Arguments: (int $cap, string $post_type)

Default: 150; min 1

Purpose: Entries per post type the Map loads.

21press_delta_map_terms_per_taxonomy

Arguments: (int $cap, string $taxonomy)

Default: 200; min 1

Purpose: Terms per taxonomy the Map loads.

21press_delta_library_catalog

Arguments: (?mixed $injected)

Default: null

Purpose: Override Cloud Library catalogue.

21press_delta_library_item

Arguments: (?mixed $injected, string $slug)

Default: null

Purpose: Override one catalogue item.

21press_delta_library_remote_json

Arguments: (?mixed $override, string $path)

Default: null

Purpose: Override remote JSON.

21press_delta_library_jwt

Arguments: (?mixed $override)

Default: null

Purpose: Override library JWT.

21press_delta_library_proof

Arguments: (?mixed $override)

Default: null

Purpose: Override library proof.

21press_delta_library_session_response

Arguments: (?mixed $override, $proof)

Default: null

Purpose: Override session response.

21press_delta_library_licensed

Arguments: (?mixed $override)

Default: null

Purpose: Override licence check.

21press_delta_coming_soon_request_allowed

Arguments: (bool $allowed, $request)

Default: computed

Purpose: Let a request through Coming Soon.

21press_delta_coming_soon_ajax_gated

Arguments: (bool $gated, string $action)

Default: false

Purpose: Gate this admin-ajax action.

21press_delta_coming_soon_rest_gated

Arguments: (bool $gated, string $route, $request)

Default: computed

Purpose: Gate this REST route.

21press_delta_enqueue_style_deps

Arguments: (array $handles)

Default: array('21press-delta-engine')

Purpose: Style dependencies.

21press_delta_design_system_source_url

Arguments: (string $url, string $handle)

Default: ''

Purpose: URL for an external design-system source.

21press_delta_design_system_sources

Arguments: (array $sources)

Default: built sources

Purpose: Design-system CSS/JS sources.

21press_delta_design_switch_external_names

Arguments: (array $names)

Default: EXTERNAL_NAMES plus globals

Purpose: Names a design switch must not rewrite.

21press_delta_late_styles_priority

Arguments: (int $priority)

Default: PHP_INT_MAX-100; ignored if <=10

Purpose: wp_head priority for late site.css.

21press_delta_google_font_installed

Arguments: ($result, string $family)

Default: install result

Purpose: After a Google font install.

21press_delta_font_catalog_url

Arguments: (string $url)

Default: built URL

Purpose: Google font catalogue URL.

21press_delta_icon_catalog_url

Arguments: (string $url)

Default: built URL

Purpose: Icon catalogue URL.

21press_delta_acss_tool_set

Arguments: (string $set)

Default: 'delta'

Purpose: Automatic.css tool set slug.

21press_delta_acss_status

Arguments: (array $out)

Default: built status

Purpose: ACSS status for design context.

21press_delta_plugin_zip_hosts

Arguments: (array $hosts)

Default: array()

Purpose: Hosts allowed for plugin zip installs.

21press_delta_rewrite_base_changed_warning

Arguments: ($warning, $old_base, $written)

Default: built warning

Purpose: CPT rewrite-base change warning.

21press_delta_agent_rate_limit

Arguments: (int $n)

Default: 600

Purpose: Signed-in agent calls per 60s.

21press_delta_auth_failure_limit

Arguments: (int $n)

Default: 20

Purpose: Failed sign-ins per IP per 60s.

21press_delta_mcp_rate_limit

Arguments: (int $n, bool $unused)

Default: 60

Purpose: Anonymous MCP calls per IP per 60s. Second arg always false.

21press_delta_client_ip

Arguments: (string $ip)

Default: detected IP

Purpose: Client IP for rate limits.

21press_delta_oauth_client_ip

Arguments: (string $ip)

Default: detected IP

Purpose: Client IP for OAuth.

21press_delta_oauth_access_token_ttl

Arguments: (int $seconds)

Default: DAY_IN_SECONDS; min 60

Purpose: Access token lifetime.

21press_delta_oauth_refresh_token_ttl

Arguments: (int $seconds)

Default: 30*DAY_IN_SECONDS; min access ttl

Purpose: Refresh token lifetime.

21press_delta_oauth_dcr_rate_limit

Arguments: (int $n)

Default: 10

Purpose: Dynamic client registration rate.

21press_delta_oauth_dcr_max_clients

Arguments: (int $n)

Default: 200; min 1

Purpose: Max OAuth clients.

21press_delta_oauth_known_redirect_hosts

Arguments: (array $hosts)

Default: claude.ai, claude.com, chatgpt.com, chat.openai.com

Purpose: Allowed OAuth redirect hosts.

Context and related guides

The SEO, contact-form and content-type design-context filters run only when a matching provider is active. Cloud Library hooks refer to the catalogue and session features behind DELTA_LAB_MODE. The constant was DELTA_DEV_MODE before 0.5.0 and the old name still works. Cloud Library import was removed. Entries::overlay_meta_query() is deprecated in 0.4.8; use Entries::overlay_post_ids().

New in 0.5.0: the class \TwentyOnePress\Delta\Conditions_API gives a companion plugin the display conditions that templates use. Its methods are catalog(), parse(), ready(), matches(), summary() and search(). Check class_exists() and Conditions_API::VERSION before you use it.

See Use your own design system, Static export, Features, Front panel, Memory, Sketchbook, Template types and includes and Display conditions.