- Timestamp:
- 09/09/2021 06:35:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r51293 r51786 1029 1029 * 1030 1030 * @since 4.7.0 1031 * 1032 * @param WP_Comment $comment Comment object. 1031 * @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support. 1032 * 1033 * @param WP_Comment $item Comment object. 1033 1034 * @param WP_REST_Request $request Request object. 1034 1035 * @return WP_REST_Response Response object. 1035 1036 */ 1036 public function prepare_item_for_response( $comment, $request ) { 1037 1038 $fields = $this->get_fields_for_response( $request ); 1039 $data = array(); 1037 public function prepare_item_for_response( $item, $request ) { 1038 // Restores the more descriptive, specific name for use within this method. 1039 $comment = $item; 1040 $fields = $this->get_fields_for_response( $request ); 1041 $data = array(); 1040 1042 1041 1043 if ( in_array( 'id', $fields, true ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.