[wp-trac] [WordPress Trac] #25104: is_admin() conditional tag is not true on the Customizer page

WordPress Trac noreply at wordpress.org
Tue Aug 20 21:24:14 UTC 2013


#25104: is_admin() conditional tag is not true on the Customizer page
--------------------------+--------------------------------------------
 Reporter:  ScottSmith    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.6
 Severity:  normal        |   Keywords:  reporter-feedback dev-feedback
--------------------------+--------------------------------------------
 Steps to Reproduce:
 1. Add the following code or similar to any page of the theme to test
 whether the is_admin() conditional tag is true or false.

 {{{
 <?php if ( ! is_admin() ) {
      echo "You are viewing the theme";
 } else {
      echo "You are viewing the WordPress Administration Panels";
 }?>
 }}}

 2. Open theme customizer

 Expected: Text should read "You are viewing the WordPress Administration
 Panels" because the theme customizer is an admin panel.

 Result: Text reads "You are viewing the theme," when in fact, you are in
 an admin panel.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25104>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list