[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 15:24:18 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 westonruter):

 @curdin I meant the PHP side of things. For the JS side of things we can
 maintain backwards compatibility by looking at the `arguments` passed to
 `loadItems`. If a second argument is passed, then we know that it's using
 the old signature of `loadItems( type, object )`. If only one argument is
 present, then we'd know that it's using the new signature.

 > 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.

 Unit test could be amended to only pass in the specific expected item
 type, right?

 In any case, let me know which PR has your preferred approach and once
 you're ready I'll do a review and commit. It's probably too late for beta2
 but it could be part of beta3 next week, unless you can hand it over to me
 in the next couple hours.

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


More information about the wp-trac mailing list