[wp-trac] [WordPress Trac] #27328: Conditional tags for wp-admin

WordPress Trac noreply at wordpress.org
Sat Mar 8 19:25:18 UTC 2014


#27328: Conditional tags for wp-admin
----------------------------+-----------------------------
 Reporter:  ericlewis       |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 On the front-end, we have access to conditional tags, which allows us to
 check which page is being requested quite declarative, and elegant.

 ```if ( is_page( 'about' ) ) { /* do something */ } ```
 ```if ( is_post_type_archive( 'people' ) ) { /* do something else */ } ```

 In wp-admin, we're not so well equipped. You have access to `$hook_suffix`
 and get_current_screen(), both of which would require writing some more,
 at times tricky to craft imperative conditionals.

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


More information about the wp-trac mailing list