render_block_core_template_part_none
Action HookDescription
Fires when a requested block template part does not exist in the database nor in the theme.Hook Information
File Location |
wp-includes/blocks/template-part.php
View on GitHub
|
Hook Type | Action |
Line Number | 109 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$template_part_id
|
The requested template part namespaced to the theme. |
array
|
$attributes
|
The block attributes. |
string
|
$template_part_file_path
|
Absolute path to the not found template path. |
Usage Examples
Basic Usage
<?php
// Hook into render_block_core_template_part_none
add_action('render_block_core_template_part_none', 'my_custom_function', 10, 3);
function my_custom_function($template_part_id, $attributes, $template_part_file_path) {
// Your custom code here
}
Source Code Context
wp-includes/blocks/template-part.php:109
- How this hook is used in WordPress core
<?php
104 *
105 * @param string $template_part_id The requested template part namespaced to the theme.
106 * @param array $attributes The block attributes.
107 * @param string $template_part_file_path Absolute path to the not found template path.
108 */
109 do_action( 'render_block_core_template_part_none', $template_part_id, $attributes, $template_part_file_path );
110 }
111 }
112 }
113
114 // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent
PHP Documentation
<?php
/**
* Fires when a requested block template part does not exist in the database nor in the theme.
*
* @since 5.9.0
*
* @param string $template_part_id The requested template part namespaced to the theme.
* @param array $attributes The block attributes.
* @param string $template_part_file_path Absolute path to the not found template path.
*/
Quick Info
- Hook Type: Action
- Parameters: 3
- File: wp-includes/blocks/template-part.php
Related Hooks
Related hooks will be displayed here in future updates.