- Timestamp:
- 01/20/2023 12:19:09 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
r54969 r55104 290 290 * @since 4.7.0 291 291 * 292 * @param array $ dataResponse data to filter.293 * @param string $context Context defined in the schema.292 * @param array $response_data Response data to filter. 293 * @param string $context Context defined in the schema. 294 294 * @return array Filtered response. 295 295 */ 296 public function filter_response_by_context( $ data, $context ) {296 public function filter_response_by_context( $response_data, $context ) { 297 297 298 298 $schema = $this->get_item_schema(); 299 299 300 return rest_filter_response_by_context( $ data, $schema, $context );300 return rest_filter_response_by_context( $response_data, $schema, $context ); 301 301 } 302 302 … … 413 413 * @since 4.7.0 414 414 * 415 * @param array $ preparedPrepared response array.416 * @param WP_REST_Request $request Full details about the request.415 * @param array $response_data Prepared response array. 416 * @param WP_REST_Request $request Full details about the request. 417 417 * @return array Modified data object with additional fields. 418 418 */ 419 protected function add_additional_fields_to_object( $ prepared, $request ) {419 protected function add_additional_fields_to_object( $response_data, $request ) { 420 420 421 421 $additional_fields = $this->get_additional_fields(); … … 432 432 } 433 433 434 $ prepared[ $field_name ] = call_user_func(434 $response_data[ $field_name ] = call_user_func( 435 435 $field_options['get_callback'], 436 $ prepared,436 $response_data, 437 437 $field_name, 438 438 $request, … … 441 441 } 442 442 443 return $ prepared;443 return $response_data; 444 444 } 445 445
Note: See TracChangeset
for help on using the changeset viewer.