scoped-style-capture.php
Captures style ownership for imported markup and translates eligible rules into portable scoped settings while avoiding unrelated document rules.
Responsibility#
Captures style ownership for imported markup and translates eligible rules into portable scoped settings while avoiding unrelated document rules.
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.
WordPress hooks#
| Operation | Hook |
|---|---|
add_action |
template_redirect |
apply_filters |
cantata_edit_capture_scoped_styles |
add_action |
wp_head |
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_scoped_style_capture_begin#
function cantata_edit_scoped_style_capture_begin( bool $frontend = false ): 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/scoped-style-capture.php:5.
cantata_edit_scoped_style_capture_prefix#
function cantata_edit_scoped_style_capture_prefix( array $entry ): ?string
Called only at the core's validated prefix generation site, before native live filling.
Source location: includes/scoped-style-capture.php:12.
cantata_edit_scoped_style_capture_finish#
function cantata_edit_scoped_style_capture_finish( string $html, array $prior, bool $frontend = false, bool $legacy = false, ?object $owned_state = null ): array
Finish only this capture, restore the enclosing context, and preserve exact original prefix order.
Source location: includes/scoped-style-capture.php:25.
cantata_edit_scoped_style_capture_buffer#
function cantata_edit_scoped_style_capture_buffer(): void
Begin an explicit whole-response buffer. Not suitable for streaming responses.
Implementation connections: cantata_edit_scoped_style_capture_begin, cantata_edit_scoped_style_capture_finish.
Source location: includes/scoped-style-capture.php:56.
cantata_edit_scoped_style_capture_head_marker#
function cantata_edit_scoped_style_capture_head_marker(): void
A theme may call this after wp_head and remove the default action to guarantee last-head order.
Source location: includes/scoped-style-capture.php:84.