wc_get_template_part filter should always run regardless of whether a matching template was found.

Closes #9851
This commit is contained in:
Mike Jolley 2015-12-16 11:28:34 +00:00
parent aab4e1cfa0
commit 992f1176bd
1 changed files with 4 additions and 4 deletions

View File

@ -136,6 +136,8 @@ function wc_update_order( $args ) {
/**
* Get template part (for templates like the shop-loop).
*
* WC_TEMPLATE_DEBUG_MODE will prevent overrides in themes from taking priority.
*
* @access public
* @param mixed $slug
* @param string $name (default: '')
@ -158,10 +160,8 @@ function wc_get_template_part( $slug, $name = '' ) {
$template = locate_template( array( "{$slug}.php", WC()->template_path() . "{$slug}.php" ) );
}
// Allow 3rd party plugin filter template file from their plugin.
if ( ( ! $template && WC_TEMPLATE_DEBUG_MODE ) || $template ) {
$template = apply_filters( 'wc_get_template_part', $template, $slug, $name );
}
// Allow 3rd party plugins to filter template file from their plugin.
$template = apply_filters( 'wc_get_template_part', $template, $slug, $name );
if ( $template ) {
load_template( $template, false );