wp-includes/rest-api/endpoints/class-wp-rest-icon-collections-controller.php:191Prepares a raw icon collection before it gets output in a REST API response.
$itemarray$requestWP_REST_RequestWP_REST_Response|WP_Error public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); $keys = array( 'slug' => 'slug', 'label' => 'label', 'description' => 'description', ); $data = array(); foreach ( $keys as $item_key => $rest_key ) { if ( isset( $item[ $item_key ] ) && rest_is_field_included( $rest_key, $fields ) ) { $data[ $rest_key ] = $item[ $item_key ]; } } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); return rest_ensure_response( $data ); }Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
src/wp-includes/rest-api/endpoints/class-wp-rest-icon-collections-controller.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.