WP HOOKS
filtrod 5.1.0

pre_render_block

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

Opis — z kodu źródłowego

Allows render_block() to be short-circuited, by returning a non-null value.

Parametry

ParametrTypOpis
$pre_renderstring | nullThe pre-rendered content. Default null.
$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. }
$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( 'pre_render_block', 'twoja_funkcja', 10, 3 );

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

Popularne w tej kategorii