do_action( ‘get_template_part’, string $slug, string $name, string[] $templates, array $args )

In this article

Fires before an attempt is made to locate and load a template part.

Parameters

$slugstring
The slug name for the generic template.
$namestring
The name of the specialized template or an empty string if there is none.
$templatesstring[]
Array of template files to search for, in order.
$argsarray
Additional arguments passed to the template.

Source

do_action( 'get_template_part', $slug, $name, $templates, $args );

Changelog

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

User Contributed Notes

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