wp-includes/general-template.php:167$slugstring$namestring|nulloptionalnull$argsarrayoptionalarray()void|false2 hooks fire while get_template_part() runs, in this order:
Fires before the specified template part file is loaded.
Fires before an attempt is made to locate and load a template part.
function get_template_part( $slug, $name = null, $args = array() ) { /** * Fires before the specified template part file is loaded. * * The dynamic portion of the hook name, `$slug`, refers to the slug name * for the generic template part. * * @since 3.0.0 * @since 5.5.0 The `$args` parameter was added. * * @param string $slug The slug name for the generic template. * @param string|null $name The name of the specialized template * or null if there is none. * @param array $args Additional arguments passed to the template. */ do_action( "get_template_part_{$slug}", $slug, $name, $args ); $templates = array(); $name = (string) $name; if ( '' !== $name ) { $templates[] = "{$slug}-{$name}.php"; } $templates[] = "{$slug}.php"; /** * Fires before an attempt is made to locate and load a template part. * * @since 5.2.0 * @since 5.5.0 The `$args` parameter was added. * * @param string $slug The slug name for the generic template. * @param string $name The name of the specialized template * or an empty string if there is none. * @param string[] $templates Array of template files to search for, in order. * @param array $args Additional arguments passed to the template. */ do_action( 'get_template_part', $slug, $name, $templates, $args ); if ( ! locate_template( $templates, true, false, $args ) ) { return false; }}Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$args parameter was added.from the docblocksrc/wp-includes/general-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.