Posts, Post Types: Ensure is_page_template() can only return true when viewing a singular post query.

Props natereist, dlh
Fixes #39211


git-svn-id: https://develop.svn.wordpress.org/trunk@39599 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2016-12-14 03:42:58 +00:00
parent 2642833293
commit c0bb5e4972
2 changed files with 30 additions and 0 deletions
+4
View File
@@ -1631,6 +1631,10 @@ function get_the_password_form( $post = 0 ) {
* @return bool True on success, false on failure.
*/
function is_page_template( $template = '' ) {
if ( ! is_singular() ) {
return false;
}
$page_template = get_page_template_slug( get_queried_object_id() );
if ( empty( $template ) )