[wp-trac] [WordPress Trac] #32766: customize_register fires twice, cannot pass data properly

WordPress Trac noreply at wordpress.org
Tue Jun 23 17:20:50 UTC 2015


#32766: customize_register fires twice, cannot pass data properly
----------------------------+-----------------------------
 Reporter:  eherman24       |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Customize       |    Version:  4.2.2
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 I am developing a plugin and attempting to build out a custom customizer
 using the default customizer page. I am able to register custom sections
 and settings without any issue, and they display on the customizer page.

 To indicate that I would like to display my custom sections and not the
 default sections I am attempting to pass in a query argument , "action=my-
 custom-query-arg-action".

 I am doing this so that if the action is my custom action, I
 remove_section the default sections. If the query arg does not exist in
 the URL, I don't want my custom sections displayed.

 I can successfully pass in a query argument using `add_query_arg()`, but
 it seems that the customize_register action fires twice. Once for the
 admin side and again for the front end. First time it returns my query
 argument properly, but on the second go around it's empty. This makes it
 impossible to pass in any query args.

 Is there a reason that the action fires twice? If it is going to fire
 twice, shouldn't it reference the admin data? I need to make use of
 customize_register hook so that I can register my custom sections. If I
 use another hook the sections are not properly registered.

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


More information about the wp-trac mailing list