mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 14:17:06 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@34163 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1175,7 +1175,7 @@ function wp_underscore_playlist_templates() {
|
||||
<img src="{{ data.thumb.src }}"/>
|
||||
<# } #>
|
||||
<div class="wp-playlist-caption">
|
||||
<span class="wp-playlist-item-meta wp-playlist-item-title"><?php
|
||||
<span class="wp-playlist-item-meta wp-playlist-item-title"><?php
|
||||
/* translators: playlist item title */
|
||||
printf( _x( '“%s”', 'playlist item title' ), '{{ data.title }}' );
|
||||
?></span>
|
||||
@@ -2076,7 +2076,8 @@ function get_attachment_taxonomies( $attachment ) {
|
||||
if ( ! is_object($attachment) )
|
||||
return array();
|
||||
|
||||
$filename = basename($attachment->guid);
|
||||
$file = get_attached_file( $attachment->ID );
|
||||
$filename = basename( $file );
|
||||
|
||||
$objects = array('attachment');
|
||||
|
||||
|
||||
@@ -4648,7 +4648,7 @@ function wp_delete_attachment( $post_id, $force_delete = false ) {
|
||||
foreach ( $comment_ids as $comment_id ) {
|
||||
wp_delete_comment( $comment_id, true );
|
||||
}
|
||||
|
||||
|
||||
wp_defer_comment_counting( false );
|
||||
|
||||
$post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $post_id ));
|
||||
@@ -4974,7 +4974,8 @@ function wp_mime_type_icon( $mime = 0 ) {
|
||||
$mime = (int) $mime;
|
||||
if ( $post = get_post( $mime ) ) {
|
||||
$post_id = (int) $post->ID;
|
||||
$ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid);
|
||||
$file = get_attached_file( $post_id );
|
||||
$ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $file);
|
||||
if ( !empty($ext) ) {
|
||||
$post_mimes[] = $ext;
|
||||
if ( $ext_type = wp_ext2type( $ext ) )
|
||||
|
||||
Reference in New Issue
Block a user