[wp-trac] [WordPress Trac] #30387: Theme customizer section vanishes if code is inside is_admin() block

WordPress Trac noreply at wordpress.org
Tue Nov 18 21:37:45 UTC 2014


#30387: Theme customizer section vanishes if code is inside is_admin() block
--------------------------+------------------------------
 Reporter:  Latz          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:  administration
--------------------------+------------------------------
Changes (by westonruter):

 * keywords:   => close


Comment:

 I think wrapping the `add_section` call in `is_admin` is incorrect anyway.
 The call merely should be done inside of the `customize_register` action.
 Since the Customizer preview executes in a frontend context, any calls
 wrapped by `is_admin` aren't going to fire regardless. This means your
 settings aren't getting registered in the preview either. It doesn't
 matter for settings though, since they get synced into the preview once
 the Customizer preview loads anyway. But sections can now be contextual to
 specific URLs, and for this to work the `add_section` mustn't be
 conditional upon `is_admin`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30387#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list