file_exists check for wc_get_template

This commit is contained in:
Mike Jolley 2014-02-11 14:48:28 +00:00 committed by Coen Jacobs
parent a7b3972ab9
commit 018e719468
1 changed files with 5 additions and 0 deletions

View File

@ -95,6 +95,11 @@ function wc_get_template( $template_name, $args = array(), $template_path = '',
$located = wc_locate_template( $template_name, $template_path, $default_path );
if ( ! file_exists( $located ) ) {
_doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', $located ) );
return;
}
do_action( 'woocommerce_before_template_part', $template_name, $template_path, $located, $args );
include( $located );