Kindly EditDocumentationTry the editor

dynamic.php

Resolves dynamic fields and repeated WordPress queries in the current render context. It handles formatting, fallbacks, pagination, alternates, and empty states.

Responsibility#

Resolves dynamic fields and repeated WordPress queries in the current render context. It handles formatting, fallbacks, pagination, alternates, and empty states.

This is an implementation reference for the released 0.9.13 module. Internal PHP helpers are not a compatibility promise for third-party callers. Prefer the documented REST, Abilities, theme, and filter contracts.

conditions, element-js, linked-components, render.

WordPress hooks#

Operation Hook
apply_filters the_content

add_action and add_filter subscribe to a hook; do_action and apply_filters expose a hook. A subscription is not itself a new extension API. Dynamic hook names are not included in this literal inventory.

Function and method reference#

cantata_edit_dyn_fields#

function cantata_edit_dyn_fields(): array

The kinds of value an element can show, by where it goes.

Source location: includes/dynamic.php:26.

cantata_edit_dyn_parse#

function cantata_edit_dyn_parse( string $json, string $tag )

A dynamic setting checked: the clean array, or WP_Error naming what is wrong. $tag: the element it is on.

Implementation connections: cantata_edit_dyn_fields.

Source location: includes/dynamic.php:36.

cantata_edit_dyn_text#

function cantata_edit_dyn_text( array $d, ?WP_Post $p ): string

The value of a text field for a post (or the page's archive), as plain words; '' when empty. Since 0.9.20, WordPress's HTML-ready titles, excerpts and names (&, –, curly quotes) are decoded once with cantata_edit_plain_text() before being written as text, so they show as typed; a metadata field's value stays as stored. cantata_edit_dyn_text_raw() returns the value before decoding.

Implementation connections: cantata_edit_dyn_teaser.

Source location: includes/dynamic.php:82.

cantata_edit_dyn_teaser#

function cantata_edit_dyn_teaser( WP_Post $p ): string

The words of a post up to its Read more boundary (or its more tag), for excerpts and archives.

Implementation connections: cantata_edit_conditions_strip.

Source location: includes/dynamic.php:114.

cantata_edit_dyn_url#

function cantata_edit_dyn_url( array $d, ?WP_Post $p ): string

The address a link field gives, or ''. Only http(s) and site-relative addresses.

Source location: includes/dynamic.php:124.

cantata_edit_dyn_image#

function cantata_edit_dyn_image( array $d, ?WP_Post $p ): ?array

A picture field: [ src, alt, srcset, sizes ] or null.

Source location: includes/dynamic.php:139.

cantata_edit_dyn_content#

function cantata_edit_dyn_content( WP_Post $p ): string

A post's content as its page shows it (never inside itself, and a protected post asks for its password).

Implementation connections: cantata_edit_element_js_owner_for_post, cantata_edit_is_built, cantata_edit_missing_alts, cantata_edit_public_forms, cantata_edit_public_links, cantata_edit_render.

Source location: includes/dynamic.php:163.

cantata_edit_dyn_render#

function cantata_edit_dyn_render( string $html, ?WP_Post $p = null ): string

Fill every dynamic element in $html from $p (and the page's archive); loops repeat with each of their posts.

Implementation connections: cantata_edit_dyn_apply, cantata_edit_filter_fill, cantata_edit_is_editing, cantata_edit_linked_inner, cantata_edit_linked_parse, cantata_edit_loop_fill.

Source location: includes/dynamic.php:182.

cantata_edit_dyn_apply#

function cantata_edit_dyn_apply( DOMElement $node, ?WP_Post $p ): void

One element filled from $p: its words, link or picture, with its before/after words and fallback.

Implementation connections: cantata_edit_dyn_content, cantata_edit_dyn_image, cantata_edit_dyn_parse, cantata_edit_dyn_text, cantata_edit_dyn_url, cantata_edit_linked_parse.

Source location: includes/dynamic.php:201.

cantata_edit_loop_parse#

function cantata_edit_loop_parse( string $json )

A loop's settings checked: the clean array or WP_Error.

Source location: includes/dynamic.php:244.

cantata_edit_loop_query#

function cantata_edit_loop_query( array $s ): WP_Query

The query a loop shows: the page's own (an archive), or its own, narrowed by its filter's choice in the address.

Implementation connections: cantata_edit_filter_choice.

Source location: includes/dynamic.php:275.

cantata_edit_loop_fill#

function cantata_edit_loop_fill( DOMElement $loop ): void

The repeated item, each post's copy, the empty state and the pagination, in place of the loop's template.

Implementation connections: cantata_edit_dyn_render, cantata_edit_linked_parse, cantata_edit_loop_parse, cantata_edit_loop_query.

Source location: includes/dynamic.php:291.

cantata_edit_filter_parse#

function cantata_edit_filter_parse( string $json )

Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.

Source location: includes/dynamic.php:349.

cantata_edit_filter_choice#

function cantata_edit_filter_choice( string $loop ): ?array

What a visitor chose in a loop's filter (?kf-=ids&kfo-=all), as [ tax, terms, op ], or null.

Source location: includes/dynamic.php:371.

cantata_edit_filter_fill#

function cantata_edit_filter_fill( DOMElement $box ): void

The filter's terms as links that narrow its loop; the chosen ones marked; "All" clears it.

Implementation connections: cantata_edit_filter_choice, cantata_edit_filter_parse.

Source location: includes/dynamic.php:385.

About this page

Documents Kindly Edit 0.9.16. Source: includes/dynamic.php. Theme choices and account permissions can change which controls appear.

Type a word or phrase to search the full documentation.