hooked_block_{$hooked_block_type}

FILTER wp-includes\blocks.php (ligne 1006) github
Filters the parsed block array for a given hooked block. The dynamic portion of the hook name, `$hooked_block_type`, refers to the block type name of the specific hooked block.

Paramètres

Entrée :
$parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block, $context
Sortie :
@param array|null                      $parsed_hooked_block The parsed block array for the given hooked block type, or null to suppress the block.
@param string                          $hooked_block_type   The hooked block type name.
@param string                          $relative_position   The relative position of the hooked block.
@param array                           $parsed_anchor_block The anchor block, in parsed block array format.
@param WP_Block_Template|WP_Post|array $context             The block template, template part, post object,

Utilisation

// Modifier la valeur avec le filtre 'hooked_block_{$hooked_block_type}'
add_filter('hooked_block_{$hooked_block_type}', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($parsed_hooked_block) {
    // Modifier la valeur
    return $parsed_hooked_block;
}

Actualités

Chargement des actualités...