get_template_part хук-событие . WP 5.2.0
Fires before a template part is loaded.
Использование
add_action( 'get_template_part', 'action_function_name_8757', 10, 4 ); function action_function_name_8757( $slug, $name, $templates, $args ){ // action... }
- $slug(строка)
- The slug name for the generic template.
- $name(строка)
- The name of the specialized template.
- $templates(строка[])
- Array of template files to search for, in order.
- $args(массив)
- Additional arguments passed to the template.
Список изменений
С версии 5.2.0 | Введена. |
С версии 5.5.0 | The $args parameter was added. |
Где вызывается хук
get_template_part
wp-includes/general-template.php 202
do_action( 'get_template_part', $slug, $name, $templates, $args );