Skip to content

Commit 74fa556

Browse files
Media: Update @SInCE tags to 7.1.0 for re-introduced client-side media.
The client-side media processing code originally targeted 7.0.0 but was removed before release in [62081]. Now that the feature is being re-introduced for 7.1, update the restored docblocks in media.php and the attachments REST controller to reflect the version the code actually ships in. Pre-existing 7.0.0 docblocks unrelated to the revert (fetchpriority support and the attachment filename/filesize helpers) are left unchanged. Addresses review feedback on WordPress#11324
1 parent 0d497ac commit 74fa556

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/wp-includes/media.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6453,7 +6453,7 @@ function wp_get_image_editor_output_format( $filename, $mime_type ) {
64536453
* Client-side media processing uses the browser's capabilities to handle
64546454
* tasks like image resizing and compression before uploading to the server.
64556455
*
6456-
* @since 7.0.0
6456+
* @since 7.1.0
64576457
*
64586458
* @return bool Whether client-side media processing is enabled.
64596459
*/
@@ -6465,7 +6465,7 @@ function wp_is_client_side_media_processing_enabled(): bool {
64656465
/**
64666466
* Filters whether client-side media processing is enabled.
64676467
*
6468-
* @since 7.0.0
6468+
* @since 7.1.0
64696469
*
64706470
* @param bool $enabled Whether client-side media processing is enabled. Default true if the page is served in a secure context.
64716471
*/
@@ -6475,7 +6475,7 @@ function wp_is_client_side_media_processing_enabled(): bool {
64756475
/**
64766476
* Sets a global JS variable to indicate that client-side media processing is enabled.
64776477
*
6478-
* @since 7.0.0
6478+
* @since 7.1.0
64796479
*/
64806480
function wp_set_client_side_media_processing_flag(): void {
64816481
if ( ! wp_is_client_side_media_processing_enabled() ) {
@@ -6507,7 +6507,7 @@ function wp_set_client_side_media_processing_flag(): void {
65076507
*
65086508
* Matches all Chromium-based browsers (Chrome, Edge, Opera, Brave).
65096509
*
6510-
* @since 7.0.0
6510+
* @since 7.1.0
65116511
*
65126512
* @return int|null The major Chrome version, or null if not a Chromium browser.
65136513
*/
@@ -6532,7 +6532,7 @@ function wp_get_chromium_major_version(): ?int {
65326532
* editor via a custom `action` query parameter, as DIP would block
65336533
* same-origin iframe access that these editors rely on.
65346534
*
6535-
* @since 7.0.0
6535+
* @since 7.1.0
65366536
*/
65376537
function wp_set_up_cross_origin_isolation(): void {
65386538
if ( ! wp_is_client_side_media_processing_enabled() ) {
@@ -6571,7 +6571,7 @@ function wp_set_up_cross_origin_isolation(): void {
65716571
*
65726572
* Uses an output buffer to add crossorigin="anonymous" where needed.
65736573
*
6574-
* @since 7.0.0
6574+
* @since 7.1.0
65756575
*/
65766576
function wp_start_cross_origin_isolation_output_buffer(): void {
65776577
$chromium_version = wp_get_chromium_major_version();
@@ -6592,7 +6592,7 @@ static function ( string $output ): string {
65926592
/**
65936593
* Adds crossorigin="anonymous" to relevant tags in the given HTML string.
65946594
*
6595-
* @since 7.0.0
6595+
* @since 7.1.0
65966596
*
65976597
* @param string $html HTML input.
65986598
* @return string Modified HTML.

src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function register_routes() {
129129
/**
130130
* Retrieves the query params for the attachments collection.
131131
*
132-
* @since 7.0.0
132+
* @since 7.1.0
133133
*
134134
* @param string $method Optional. HTTP method of the request.
135135
* The arguments for `CREATABLE` requests are
@@ -289,7 +289,7 @@ public function create_item_permissions_check( $request ) {
289289
* Creates a single attachment.
290290
*
291291
* @since 4.7.0
292-
* @since 7.0.0 Added `generate_sub_sizes` and `convert_format` parameters.
292+
* @since 7.1.0 Added `generate_sub_sizes` and `convert_format` parameters.
293293
*
294294
* @param WP_REST_Request $request Full details about the request.
295295
* @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure.
@@ -413,7 +413,7 @@ public function create_item( $request ) {
413413
/**
414414
* Removes filters added for client-side media processing.
415415
*
416-
* @since 7.0.0
416+
* @since 7.1.0
417417
*/
418418
private function remove_client_side_media_processing_filters(): void {
419419
remove_filter( 'intermediate_image_sizes_advanced', '__return_empty_array', 100 );
@@ -1994,7 +1994,7 @@ protected function get_attachment_filesize( int $attachment_id ): ?int {
19941994
* Sideloading a file for an existing attachment
19951995
* requires both update and create permissions.
19961996
*
1997-
* @since 7.0.0
1997+
* @since 7.1.0
19981998
*
19991999
* @param WP_REST_Request $request Full details about the request.
20002000
* @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.
@@ -2006,7 +2006,7 @@ public function sideload_item_permissions_check( $request ) {
20062006
/**
20072007
* Side-loads a media file without creating a new attachment.
20082008
*
2009-
* @since 7.0.0
2009+
* @since 7.1.0
20102010
*
20112011
* @param WP_REST_Request $request Full details about the request.
20122012
* @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure.
@@ -2177,7 +2177,7 @@ public function sideload_item( WP_REST_Request $request ) {
21772177
* However, here it is desired not to add the suffix in order to maintain the same
21782178
* naming convention as if the file was uploaded regularly.
21792179
*
2180-
* @since 7.0.0
2180+
* @since 7.1.0
21812181
*
21822182
* @link https://github.com/WordPress/wordpress-develop/blob/30954f7ac0840cfdad464928021d7f380940c347/src/wp-includes/functions.php#L2576-L2582
21832183
*
@@ -2219,7 +2219,7 @@ private static function filter_wp_unique_filename( $filename, $dir, $number, $at
22192219
* server-side plugins can process the attachment after all client-side
22202220
* operations (upload, thumbnail generation, sideloads) are complete.
22212221
*
2222-
* @since 7.0.0
2222+
* @since 7.1.0
22232223
*
22242224
* @param WP_REST_Request $request Full details about the request.
22252225
* @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure.

0 commit comments

Comments
 (0)