Make WordPress Core


Ignore:
Timestamp:
09/15/2015 02:49:12 AM (9 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/async-upload.php

    r34059 r34163  
    6363                echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />';
    6464            echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>';
    65             $title = $post->post_title ? $post->post_title : wp_basename( $post->guid ); // Title shouldn't ever be empty, but use filename just in case.
     65
     66            // Title shouldn't ever be empty, but use filename just in case.
     67            $file = get_attached_file( $post->ID );
     68            $title = $post->post_title ? $post->post_title : wp_basename( $file );
    6669            echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60, '&hellip;' ) ) . '</span></div>';
    6770            break;
Note: See TracChangeset for help on using the changeset viewer.