Make WordPress Core


Ignore:
Timestamp:
12/16/2016 05:40:01 AM (10 years ago)
Author:
dd32
Message:

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

Props natereist, dlh, johnbillion.
Merges [39599] to the 4.7 branch.
Fixes #39211.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/post-template.php

    r38951 r39608  
    16321632 */
    16331633function is_page_template( $template = '' ) {
     1634        if ( ! is_singular() ) {
     1635                return false;
     1636        }
     1637
    16341638        $page_template = get_page_template_slug( get_queried_object_id() );
    16351639
Note: See TracChangeset for help on using the changeset viewer.