Make WordPress Core

Ticket #33386: 33386.diff

File 33386.diff, 5.7 KB (added by wonderboymusic, 10 years ago)
  • src/wp-admin/async-upload.php

     
    6262                        if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) )
    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;
    6871                case 2 :
  • src/wp-admin/custom-header.php

     
    11161116         */
    11171117        final public function create_attachment_object( $cropped, $parent_attachment_id ) {
    11181118                $parent = get_post( $parent_attachment_id );
    1119                 $parent_url = $parent->guid;
     1119                $parent_url = wp_get_attachment_url( $parent->ID );
    11201120                $url = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
    11211121
    11221122                $size = @getimagesize( $cropped );
  • src/wp-admin/includes/ajax-actions.php

     
    31553155                        /** This filter is documented in wp-admin/custom-header.php */
    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
    31613161                        $size       = @getimagesize( $cropped );
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    370370                        <?php echo $link_end; ?>
    371371                        <?php _media_states( $post ); ?>
    372372                </strong>
    373                 <p class="filename"><span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span><?php echo wp_basename( $post->guid ); ?></p>
     373                <p class="filename">
     374                        <span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span>
     375                        <?php
     376                        $file = get_attached_file( $post->ID );
     377                        echo wp_basename( $file );
     378                        ?>
     379                </p>
    374380                <?php
    375381        }
    376382
  • src/wp-admin/includes/class-wp-site-icon.php

     
    8080         */
    8181        public function create_attachment_object( $cropped, $parent_attachment_id ) {
    8282                $parent     = get_post( $parent_attachment_id );
    83                 $parent_url = $parent->guid;
     83                $parent_url = wp_get_attachment_url( $parent->ID );
    8484                $url        = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
    8585
    8686                $size       = @getimagesize( $cropped );
  • src/wp-admin/includes/media.php

     
    13681368        $toggle_on  = __( 'Show' );
    13691369        $toggle_off = __( 'Hide' );
    13701370
    1371         $filename = esc_html( wp_basename( $post->guid ) );
     1371        $file = get_attached_file( $post->ID );
     1372        $filename = esc_html( wp_basename( $file ) );
    13721373        $title = esc_attr( $post->post_title );
    13731374
    13741375        $post_mime_types = get_post_mime_types();
  • src/wp-includes/media.php

     
    11751175        <img src="{{ data.thumb.src }}"/>
    11761176        <# } #>
    11771177        <div class="wp-playlist-caption">
    1178                 <span class="wp-playlist-item-meta wp-playlist-item-title"><?php 
     1178                <span class="wp-playlist-item-meta wp-playlist-item-title"><?php
    11791179                        /* translators: playlist item title */
    11801180                        printf( _x( '&#8220;%s&#8221;', 'playlist item title' ), '{{ data.title }}' );
    11811181                ?></span>
     
    20762076        if ( ! is_object($attachment) )
    20772077                return array();
    20782078
    2079         $filename = basename($attachment->guid);
     2079        $file = get_attached_file( $attachment->ID );
     2080        $filename = basename( $file );
    20802081
    20812082        $objects = array('attachment');
    20822083
  • src/wp-includes/post-functions.php

     
    46484648        foreach ( $comment_ids as $comment_id ) {
    46494649                wp_delete_comment( $comment_id, true );
    46504650        }
    4651        
     4651
    46524652        wp_defer_comment_counting( false );
    46534653
    46544654        $post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $post_id ));
     
    49744974                        $mime = (int) $mime;
    49754975                        if ( $post = get_post( $mime ) ) {
    49764976                                $post_id = (int) $post->ID;
    4977                                 $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid);
     4977                                $file = get_attached_file( $post_id );
     4978                                $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $file);
    49784979                                if ( !empty($ext) ) {
    49794980                                        $post_mimes[] = $ext;
    49804981                                        if ( $ext_type = wp_ext2type( $ext ) )