file_exists check for wc_get_template
This commit is contained in:
parent
a7b3972ab9
commit
018e719468
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue