Kindly EditDocumentationTry the editor

blocks.php

Loads the built-in block catalog, parses metadata, substitutes theme-aware placeholders, and exposes appropriate insertion choices.

Responsibility#

Loads the built-in block catalog, parses metadata, substitutes theme-aware placeholders, and exposes appropriate insertion choices.

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.

icon-library, popups, render, rest, scoped-style-capture, theme.

WordPress hooks#

Operation Hook
add_filter cantata_edit_live_sources
apply_filters cantata_edit_blocks
apply_filters cantata_edit_unoffered_blocks
apply_filters cantata_edit_live_sources
add_action rest_api_init
apply_filters cantata_edit_capture_scoped_styles
apply_filters cantata_edit_live_preview_html
add_action wp_enqueue_scripts
add_filter cantata_edit_native_custom_properties
add_action wp_footer
apply_filters cantata_edit_show_edit_button

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_blocks#

function cantata_edit_blocks(): array

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

Implementation connections: cantata_edit_config, cantata_edit_icon_library, cantata_edit_parse_keywords, cantata_edit_parse_layouts, cantata_edit_tokens, cantata_edit_unoffered_blocks.

Source location: includes/blocks.php:24.

cantata_edit_unoffered_blocks#

function cantata_edit_unoffered_blocks(): array

Elements not offered for adding yet. They stay registered, so a page that already has one keeps its name, settings and behavior; only the add menus, Elements panel and search leave them out.

Source location: includes/blocks.php:92.

cantata_edit_section_shell#

function cantata_edit_section_shell(): array

How a block becomes a whole section: the theme's shell, with an optional heading.

Implementation connections: cantata_edit_config.

Source location: includes/blocks.php:97.

cantata_edit_live_sources#

function cantata_edit_live_sources(): array

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/blocks.php:105.

cantata_edit_live_source_for#

function cantata_edit_live_source_for( string $tag ): ?array

The registered live source for a shortcode tag, or null.

Implementation connections: cantata_edit_live_sources.

Source location: includes/blocks.php:117.

cantata_edit_live_normalize#

function cantata_edit_live_normalize( string $code ): string

A live slot's shortcode made safe to run, or '' when it can't run: only shortcodes registered as live sources (cantata_edit_live_sources) ever run, for anyone, and only with the options the source declares, numbers clamped to their min/max. So a stored data-ce-shortcode="gallery" or [anything_else] never runs on the public page.

Implementation connections: cantata_edit_live_source_for.

Source location: includes/blocks.php:131.

cantata_edit_live_allowed#

function cantata_edit_live_allowed( string $code ): bool

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

Implementation connections: cantata_edit_asset_ver, cantata_edit_config, cantata_edit_live_normalize, cantata_edit_scoped_style_capture_begin, cantata_edit_scoped_style_capture_finish, cantata_edit_site_has_popups.

Source location: includes/blocks.php:161.

cantata_edit_block_transient#

function cantata_edit_block_transient(): array

What blocks.js changes while a page runs, reset before a save (merged with the theme's own list).

Source location: includes/blocks.php:248.

cantata_edit_block_styles#

function cantata_edit_block_styles(): array

The closed lists of choices that come with the blocks (the theme's own lists are added to these).

Implementation connections: cantata_edit_block_layout_styles.

Source location: includes/blocks.php:260.

cantata_edit_block_layout_styles#

function cantata_edit_block_layout_styles(): array

A "Layout" list for every block that declares Layouts, on the section that holds it.

Implementation connections: cantata_edit_blocks, cantata_edit_has_draft, cantata_edit_is_editing, cantata_edit_url.

Source location: includes/blocks.php:270.

About this page

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

Type a word or phrase to search the full documentation.