Make WordPress Core


Ignore:
Timestamp:
09/15/2015 02:49:12 AM (10 years ago)
Author:
wonderboymusic
Message:

Don't ever use the guid value when retrieving URLs for media, use wp_get_attachment_url(). Use get_attached_file() for path to file.

Fixes #33386.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r34161 r34163  
    31563156            $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
    31573157
    3158             $parent_url = get_post( $attachment_id )->guid;
     3158            $parent_url = wp_get_attachment_url( $attachment_id );
    31593159            $url        = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
    31603160
Note: See TracChangeset for help on using the changeset viewer.