The check for false !== $custom_page_template is too strict as get_post_meta returns an empty string rather than (bool) false. This incorrectly caused the $custom_page_template if statement to return true which then caused a locate_template( array( '' ) ); further down which would fail thus causing pages to fall back to using single.php instead of page.php.
This PR loosens the $custom_page_template check so that any falsey value will cause a fallback to page.php.
The actual code change is in c8f09ce in-case you want just that and not the associated whitespace cleanup in 6f908e1
Would be great to get this merged as it's affecting a current project.
The check for
false !== $custom_page_template
is too strict asget_post_meta
returns an empty string rather than(bool) false
. This incorrectly caused the$custom_page_template
if statement to return true which then caused alocate_template( array( '' ) );
further down which would fail thus causing pages to fall back to usingsingle.php
instead ofpage.php
.This PR loosens the
$custom_page_template
check so that any falsey value will cause a fallback topage.php
.The actual code change is in c8f09ce in-case you want just that and not the associated whitespace cleanup in 6f908e1
Would be great to get this merged as it's affecting a current project.