[wp-trac] [WordPress Trac] #36697: Combining the HTTP requests for obtaining the available nav menu items into a single request

WordPress Trac noreply at wordpress.org
Wed Nov 2 07:31:51 UTC 2016


#36697: Combining the HTTP requests for obtaining the available nav menu items into
a single request
-------------------------------------------------+-------------------------
 Reporter:  nguyencongtuan                       |       Owner:  curdin
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.7
Component:  Customize                            |     Version:  4.3
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing needs-patch needs-     |     Focuses:
  unit-tests                                     |
-------------------------------------------------+-------------------------

Comment (by curdin):

 @westonruter sorry, I'm not sure I quite follow. I can certainly amend the
 `loadItems` to take either `type` and `object`, or an array passed into
 `type`. However the tests fail not because `loadItems` has been amended,
 but because in my initial patch the ajax handler was changed to receive an
 array.

 My preferred approach would be the following:

 * 'loadItems' takes an array of itemType(s), if you prefer I can also
 leave the `type` and `object` params available
 * loadItems makes request to ajax handler using an array of itemTypes.
 * Ajax handler returns an array of itemTypes and their items. This breaks
 the current tests as they expect a set of items for the requested itemType
 only.
 * `loadItems` processes this array and injects data into DOM as required

 Does this make sense? Give me a shout on Slack if not.

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


More information about the wp-trac mailing list