WP HOOKS
filtrod 5.1.0

render_block_data

Args 3Plik wp-includes/blocks.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the block being rendered in render_block(), before it's processed.

Parametry

ParametrTypOpis
$parsed_blockarray{ An associative array of the block being rendered. See WP_Block_Parser_Block. @type string|null $blockName Name of block. @type array $attrs Attributes from block comment delimiters. @type array[] $innerBlocks List of inner blocks. An array of arrays that have the same structure as this one. @type string $innerHTML HTML from inside block comment delimiters. @type array $innerContent List of string fragments and null markers where inner blocks were found. }
$source_blockarray{ An un-modified copy of <code>$parsed_block</code>, as it appeared in the source content. See WP_Block_Parser_Block. @type string|null $blockName Name of block. @type array $attrs Attributes from block comment delimiters. @type array[] $innerBlocks List of inner blocks. An array of arrays that have the same structure as this one. @type string $innerHTML HTML from inside block comment delimiters. @type array $innerContent List of string fragments and null markers where inner blocks were found. }
$parent_block\WP_Block | nullIf this is a nested block, a reference to the parent block.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'render_block_data', 'twoja_funkcja', 10, 3 );

function twoja_funkcja($param_1, $param_2, $param_3) {
	// Twój kod
}

Popularne w tej kategorii