Changeset 47351 for trunk/src/wp-includes/rest-api/class-wp-rest-server.php
- Timestamp:
- 02/24/2020 06:05:12 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r47326 r47351 880 880 $path = $request->get_route(); 881 881 882 $ routes= array();882 $with_namespace = array(); 883 883 884 884 foreach ( $this->get_namespaces() as $namespace ) { 885 if ( 0 === strpos( ltrim( $path, '/' ), $namespace ) ) { 886 $routes = $this->get_routes( $namespace ); 887 break; 888 } 889 } 890 891 if ( ! $routes ) { 885 if ( 0 === strpos( trailingslashit( ltrim( $path, '/' ) ), $namespace ) ) { 886 $with_namespace[] = $this->get_routes( $namespace ); 887 } 888 } 889 890 if ( $with_namespace ) { 891 $routes = array_merge( ...$with_namespace ); 892 } else { 892 893 $routes = $this->get_routes(); 893 894 }
Note: See TracChangeset
for help on using the changeset viewer.