Make WordPress Core


Ignore:
Timestamp:
03/01/2023 12:34:18 AM (17 months ago)
Author:
azaozz
Message:

Media: Revert the addition of a $size parameter to get_attached_file().

Reverts [55199], [55202], and [55217] but keeps the updated docs.

Props: flixos90, joedolson, azaozz.
Fixes: #51780.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media/wpGenerateAttachmentMetadata.php

    r55199 r55437  
    1919     *
    2020     * @ticket 49412
    21      * @ticket 51780
    2221     *
    2322     * @covers ::wp_create_image_subsizes
     
    3029        $this->assertSame( wp_filesize( get_attached_file( $attachment ) ), $metadata['filesize'] );
    3130
    32         foreach ( $metadata['sizes'] as $size => $intermediate_size ) {
     31        foreach ( $metadata['sizes'] as $intermediate_size ) {
    3332            $this->assertArrayHasKey( 'filesize', $intermediate_size );
    3433            $this->assertNotEmpty( $intermediate_size['filesize'] );
    3534            $this->assertIsNumeric( $intermediate_size['filesize'] );
    36             $this->assertStringContainsString( $intermediate_size['file'], get_attached_file( $attachment, false, $size ) );
    3735        }
    3836    }
Note: See TracChangeset for help on using the changeset viewer.