[wp-trac] [WordPress Trac] #39413: Problem with WP 4.7 and "is_page_template" function

WordPress Trac noreply at wordpress.org
Wed Dec 28 09:02:26 UTC 2016


#39413: Problem with WP 4.7 and "is_page_template" function
--------------------------+-----------------------------
 Reporter:  mekshq        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi,

 I have found a strange bug in the recent WP 4.7 version which is probably
 related to new feature that allows templates for all post types.

 Here is the info:

 You have some page template, for example template-example.php and you
 assign a page to it. Then, if any taxonomy (category, tag, or any custom)
 uses the same ID as that page, when is_page_template('template-
 example.php') is called on taxonomy template it will always return true. I
 guess the problem should be easily fixed if you just add a conditional
 statement is_singular() within is_page_template function.

 Hope this is clear enough.

 Cheers!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39413>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list