Changeset 49257 for trunk/src/wp-includes/rest-api/class-wp-rest-server.php
- Timestamp:
- 10/20/2020 08:17:20 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r49252 r49257 1381 1381 } 1382 1382 1383 $allowed_schema_keywords = array_flip( rest_get_allowed_schema_keywords() ); 1384 1383 1385 $route = preg_replace( '#\(\?P<(\w+?)>.*?\)#', '{$1}', $route ); 1384 1386 … … 1398 1400 1399 1401 foreach ( $callback['args'] as $key => $opts ) { 1400 $arg_data = array( 1401 'required' => ! empty( $opts['required'] ), 1402 ); 1403 if ( isset( $opts['default'] ) ) { 1404 $arg_data['default'] = $opts['default']; 1405 } 1406 if ( isset( $opts['enum'] ) ) { 1407 $arg_data['enum'] = $opts['enum']; 1408 } 1409 if ( isset( $opts['description'] ) ) { 1410 $arg_data['description'] = $opts['description']; 1411 } 1412 if ( isset( $opts['type'] ) ) { 1413 $arg_data['type'] = $opts['type']; 1414 } 1415 if ( isset( $opts['items'] ) ) { 1416 $arg_data['items'] = $opts['items']; 1417 } 1402 $arg_data = array_intersect_key( $opts, $allowed_schema_keywords ); 1403 $arg_data['required'] = ! empty( $opts['required'] ); 1404 1418 1405 $endpoint_data['args'][ $key ] = $arg_data; 1419 1406 }
Note: See TracChangeset
for help on using the changeset viewer.