diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index f9ab2265457..449b7a2c6c4 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -194,15 +194,15 @@ function wc_get_template( $template_name, $args = array(), $template_path = '', $located = wc_locate_template( $template_name, $template_path, $default_path ); + // Allow 3rd party plugin filter template file from their plugin. + $located = apply_filters( 'wc_get_template', $located, $template_name, $args, $template_path, $default_path ); + if ( ! file_exists( $located ) ) { /* translators: %s template */ wc_doing_it_wrong( __FUNCTION__, sprintf( __( '%s does not exist.', 'woocommerce' ), '' . $located . '' ), '2.1' ); return; } - // Allow 3rd party plugin filter template file from their plugin. - $located = apply_filters( 'wc_get_template', $located, $template_name, $args, $template_path, $default_path ); - do_action( 'woocommerce_before_template_part', $template_name, $template_path, $located, $args ); include $located;