do_action( “get_template_part_{$slug}”, string $slug, string|null $name, array $args )

In this article

Fires before the specified template part file is loaded.

Description

The dynamic portion of the hook name, $slug, refers to the slug name for the generic template part.

Parameters

$slugstring
The slug name for the generic template.
$namestring|null
The name of the specialized template or null if there is none.
$argsarray
Additional arguments passed to the template.

Source

do_action( "get_template_part_{$slug}", $slug, $name, $args );

Changelog

VersionDescription
5.5.0The $args parameter was added.
3.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.