Filter hook 'register_block_type_args'

in WP Core File wp-includes/class-wp-block-type.php at line 573

View Source

register_block_type_args

Filter Hook
Description
Filters the arguments for registering a block type.

Hook Information

File Location wp-includes/class-wp-block-type.php View on GitHub
Hook Type Filter
Line Number 573

Hook Parameters

Type Name Description
array $args Array of arguments for registering a block type.
string $block_type Block type name including namespace.

Usage Examples

Basic Usage
<?php
// Hook into register_block_type_args
add_filter('register_block_type_args', 'my_custom_filter', 10, 2);

function my_custom_filter($args, $block_type) {
    // Your custom filtering logic here
    return $args;
}

Source Code Context

wp-includes/class-wp-block-type.php:573 - How this hook is used in WordPress core
<?php
 568  		 * @since 5.5.0
 569  		 *
 570  		 * @param array  $args       Array of arguments for registering a block type.
 571  		 * @param string $block_type Block type name including namespace.
 572  		 */
 573  		$args = apply_filters( 'register_block_type_args', $args, $this->name );
 574  
 575  		foreach ( $args as $property_name => $property_value ) {
 576  			$this->$property_name = $property_value;
 577  		}
 578  	}

PHP Documentation

<?php
/**
		 * Filters the arguments for registering a block type.
		 *
		 * @since 5.5.0
		 *
		 * @param array  $args       Array of arguments for registering a block type.
		 * @param string $block_type Block type name including namespace.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-block-type.php
Related Hooks

Related hooks will be displayed here in future updates.