Validate page template
This commit is contained in:
parent
3dd2cb1a66
commit
b62457dd01
|
@ -127,7 +127,16 @@ class WC_Template_Loader {
|
|||
$templates[] = 'woocommerce.php';
|
||||
|
||||
if ( is_page_template() ) {
|
||||
$templates[] = get_page_template_slug();
|
||||
$page_template = get_page_template_slug();
|
||||
|
||||
if ( $page_template ) {
|
||||
$validated_file = validate_file( $page_template );
|
||||
if ( 0 === $validated_file ) {
|
||||
$templates[] = $page_template;
|
||||
} else {
|
||||
error_log( "WooCommerce: Unable to validate template path: \"$page_template\". Error Code: $validated_file." );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_singular( 'product' ) ) {
|
||||
|
|
Loading…
Reference in New Issue