[wp-trac] [WordPress Trac] #15686: Detect the current page template tag

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 5 13:18:11 UTC 2010


#15686: Detect the current page  template tag
--------------------------------------+-------------------------------------
 Reporter:  numediaweb                |        Owner:            
     Type:  feature request           |       Status:  closed    
 Priority:  normal                    |    Milestone:            
Component:  Template                  |      Version:  3.1       
 Severity:  normal                    |   Resolution:  worksforme
 Keywords:  get_current_page pagenow  |  
--------------------------------------+-------------------------------------
Changes (by nacin):

  * status:  new => closed
  * resolution:  => worksforme
  * milestone:  Awaiting Review =>


Comment:

 It's fine to reference globals. Using pagenow is quite common in fact.

 That said, there's the `$current_screen` object, which if you prefer, has
 its own getter, `get_current_screen()`. This was introduced in 3.0 and
 includes much more information and context than pagenow.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15686#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list