Changeset 57603
- Timestamp:
- 02/12/2024 10:15:45 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r57524 r57603 172 172 } 173 173 174 175 176 177 178 179 180 181 174 182 if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { 175 183 $meta_update = $this->meta->update_value( $request['meta'], $attachment_id ); … … 324 332 325 333 /** 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 326 371 * Updates a single attachment. 327 372 * … … 355 400 356 401 $attachment = get_post( $request['id'] ); 402 403 404 405 406 407 408 409 357 410 358 411 $fields_update = $this->update_additional_fields_for_object( $attachment, $request ); -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r57230 r57603 2378 2378 'revisions', 2379 2379 'custom-fields', 2380 2380 2381 ), 2381 2382 ); -
trunk/tests/phpunit/includes/testcase-rest-post-type-controller.php
r56549 r57603 78 78 } 79 79 80 if ( post_type_supports( $post->post_type, 'thumbnail' ) ) { 80 if ( 81 post_type_supports( $post->post_type, 'thumbnail' ) || 82 ( 83 'attachment' === $post->post_type && 84 ( 85 post_type_supports( 'attachment:audio', 'thumbnail' ) || 86 post_type_supports( 'attachment:video', 'thumbnail' ) 87 ) 88 ) 89 ) { 81 90 $this->assertSame( (int) get_post_thumbnail_id( $post->ID ), $data['featured_media'] ); 82 91 } else { -
trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r57380 r57603 1066 1066 $term = wp_get_post_terms( $attachment['id'], 'category' ); 1067 1067 $this->assertSame( $category['term_id'], $term[0]->term_id ); 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1068 1139 } 1069 1140 … … 1577 1648 $data = $response->get_data(); 1578 1649 $properties = $data['schema']['properties']; 1579 $this->assertCount( 2 7, $properties );1650 $this->assertCount( 2, $properties ); 1580 1651 $this->assertArrayHasKey( 'author', $properties ); 1581 1652 $this->assertArrayHasKey( 'alt_text', $properties ); … … 1611 1682 $this->assertArrayHasKey( 'type', $properties ); 1612 1683 $this->assertArrayHasKey( 'missing_image_sizes', $properties ); 1684 1613 1685 } 1614 1686 -
trunk/tests/qunit/fixtures/wp-api-generated.js
r57548 r57603 7316 7316 "required": false 7317 7317 }, 7318 7319 7320 7321 7322 7318 7323 "comment_status": { 7319 7324 "description": "Whether or not comments are open on the post.", … … 7515 7520 "author": { 7516 7521 "description": "The ID for the author of the post.", 7522 7523 7524 7525 7526 7517 7527 "type": "integer", 7518 7528 "required": false … … 12694 12704 }, 12695 12705 "author": 0, 12706 12696 12707 "comment_status": "open", 12697 12708 "ping_status": "closed", … … 12755 12766 }, 12756 12767 "author": 0, 12768 12757 12769 "comment_status": "open", 12758 12770 "ping_status": "closed",
Note: See TracChangeset
for help on using the changeset viewer.