Make WordPress Core


Ignore:
Timestamp:
02/24/2017 10:47:47 PM (8 years ago)
Author:
SergeyBiryukov
Message:

REST API: JavaScript client - improve route discovery for custom namespaces.

Fix parsing of custom namespace routes. Transform class names, removing dashes and capitalizing each word/route part so a route path of widgets/recent-posts becomes a collection with the name WidgetsRecentPosts. Correct parent route part when routes are longer than expected, reversing parse direction.

Props westonruter, jazbek, adamsilverstein, jnylen0.
Merges [40074] and [40109] to the 4.7 branch.
Fixes #39561.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/tests/qunit/index.html

    r40116 r40117  
    4141            <script src="fixtures/customize-widgets.js"></script>
    4242            <script src="fixtures/wp-api-generated.js"></script>
     43            <script src="fixtures/js-widgets-endpoint.js"></script>
    4344            <script src="fixtures/wp-api.js"></script>
    4445        </div>
Note: See TracChangeset for help on using the changeset viewer.