wphooks.info - get_template_part_{$slug}

get_template_part_{$slug}

(trunk - 5.0-alpha-42177)

The hook occurs in the following file:

wp-includes/general-template.php:
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
	 * 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
	 *
	 * @param string      $slug The slug name for the generic template.
	 * @param string|null $name The name of the specialized template.
	 */
	do_action( "get_template_part_{$slug}", $slug, $name );

	$templates = array();
	$name = (string) $name;
	if ( '' !== $name )
		$templates[] = "{$slug}-{$name}.php";

	$templates[] = "{$slug}.php";

	locate_template($templates, true, false);