From 992f1176bd137f91a1456eca9f563b6ef5b89455 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 16 Dec 2015 11:28:34 +0000 Subject: [PATCH] wc_get_template_part filter should always run regardless of whether a matching template was found. Closes #9851 --- includes/wc-core-functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index e9db4718f24..3ab71dd93fe 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -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 );