Make WordPress Core

Changeset 47274


Ignore:
Timestamp:
02/11/2020 07:45:46 PM (5 years ago)
Author:
azaozz
Message:

Media: Pass through the $unfiltered param to get_attached_file() in wp_get_original_image_path().

Props ianmjones, joemcgill, azaozz.
Fixes #48421.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r47233 r47274  
    71787178 *
    71797179 * @since 5.3.0
    7180  *
    7181  * @param int $attachment_id Attachment ID.
     7180 * @since 5.4.0 Added the `$unfiltered` parameter.
     7181 *
     7182 * @param int  $attachment_id Attachment ID.
     7183 * @param bool $unfiltered Optional. Passed through to `get_attached_file()`. Default false.
    71827184 * @return string|false Path to the original image file or false if the attachment is not an image.
    71837185 */
    7184 function wp_get_original_image_path( $attachment_id ) {
     7186function wp_get_original_image_path( $attachment_id, $unfiltered = false ) {
    71857187    if ( ! wp_attachment_is_image( $attachment_id ) ) {
    71867188        return false;
     
    71887190
    71897191    $image_meta = wp_get_attachment_metadata( $attachment_id );
    7190     $image_file = get_attached_file( $attachment_id );
     7192    $image_file = get_attached_file( $attachment_id, $unfiltered );
    71917193
    71927194    if ( empty( $image_meta['original_image'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.