Make WordPress Core

Ticket #32531: media_filename.patch

File media_filename.patch, 623 bytes (added by daxelrod, 11 years ago)

Patch to replace GUID with attachment filename

  • wp-includes/media.php

     
    27082708        $response = array(
    27092709                'id'          => $attachment->ID,
    27102710                'title'       => $attachment->post_title,
    2711                 'filename'    => wp_basename( $attachment->guid ),
     2711                'filename'    => wp_basename( get_attached_file( $attachment->ID ) ),
    27122712                'url'         => $attachment_url,
    27132713                'link'        => get_attachment_link( $attachment->ID ),
    27142714                'alt'         => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),