Changeset 63509 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
- Timestamp:
- 09/06/2026 06:38:39 PM (13 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r63200 r63509 1292 1292 1293 1293 // Set new attachment post title with fallbacks. 1294 $new_attachment_post->post_title = $new_attachment_post->post_title ??$original_attachment_post->post_title ?? $image_name;1294 $new_attachment_post->post_title ??= $original_attachment_post->post_title ?? $image_name; 1295 1295 1296 1296 // Set new attachment post caption (post_excerpt). 1297 $new_attachment_post->post_excerpt = $new_attachment_post->post_excerpt ??$original_attachment_post->post_excerpt ?? '';1297 $new_attachment_post->post_excerpt ??= $original_attachment_post->post_excerpt ?? ''; 1298 1298 1299 1299 // Set new attachment post description (post_content) with fallbacks. 1300 $new_attachment_post->post_content = $new_attachment_post->post_content ??$original_attachment_post->post_content ?? '';1300 $new_attachment_post->post_content ??= $original_attachment_post->post_content ?? ''; 1301 1301 1302 1302 // Set post parent if set in request, else the default of `0` (no parent). 1303 $new_attachment_post->post_parent = $new_attachment_post->post_parent ??0;1303 $new_attachment_post->post_parent ??= 0; 1304 1304 1305 1305 // Insert the new attachment post. … … 1526 1526 } 1527 1527 1528 $metadata['sizes'] = $metadata['sizes'] ??array();1528 $metadata['sizes'] ??= array(); 1529 1529 1530 1530 $fallback_sizes = array( … … 3300 3300 } 3301 3301 3302 $metadata['sizes'] = $metadata['sizes'] ??array();3302 $metadata['sizes'] ??= array(); 3303 3303 3304 3304 foreach ( $image_size as $name ) { … … 3385 3385 } 3386 3386 3387 $metadata['sizes'] = $metadata['sizes'] ??array();3387 $metadata['sizes'] ??= array(); 3388 3388 3389 3389 $metadata['sizes'][ $image_size ] = array(
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)