diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 1923c79b48..b225665a3e 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -154,6 +154,17 @@ function get_template_part( $slug, $name = null ) { $templates[] = "{$slug}.php"; + /** + * Fires before a template part is loaded. + * + * @since 5.2.0 + * + * @param string $slug The slug name for the generic template. + * @param string $name The name of the specialized template. + * @param string[] $templates Array of template files to search for, in order. + */ + do_action( 'get_template_part', $slug, $name, $templates ); + locate_template( $templates, true, false ); }