Changeset 44933 for trunk/src/wp-includes/rest-api.php
- Timestamp:
- 03/19/2019 03:21:28 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r44698 r44933 616 616 617 617 foreach ( $handler->get_routes() as $route => $endpoints ) { 618 $match = preg_match( '@^' . $route . '$@i', $request->get_route() );618 $match = preg_match( '@^' . $route . '$@i', $request->get_route(), $matches ); 619 619 620 620 if ( ! $match ) { 621 621 continue; 622 } 623 624 $args = array(); 625 foreach ( $matches as $param => $value ) { 626 if ( ! is_int( $param ) ) { 627 $args[ $param ] = $value; 628 } 629 } 630 631 foreach ( $endpoints as $endpoint ) { 632 // Remove the redundant preg_match argument. 633 unset( $args[0] ); 634 635 $request->set_url_params( $args ); 636 $request->set_attributes( $endpoint ); 622 637 } 623 638
Note: See TracChangeset
for help on using the changeset viewer.