Use attachment title instead of filename, unless it is empty
git-svn-id: https://develop.svn.wordpress.org/trunk@7533 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bfc779927b
commit
f7c21d131d
|
@ -644,10 +644,12 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||||
$toggle_links = '';
|
$toggle_links = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
|
||||||
|
|
||||||
$item = "
|
$item = "
|
||||||
$type
|
$type
|
||||||
$toggle_links
|
$toggle_links
|
||||||
<div class='filename new'>$filename</div>
|
<div class='filename new'>$display_title</div>
|
||||||
<table class='slidetoggle describe $class'>
|
<table class='slidetoggle describe $class'>
|
||||||
<tbody class='media-item-info'>
|
<tbody class='media-item-info'>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -53,7 +53,7 @@ function autosave_saved_new(response) {
|
||||||
var tempID = jQuery('#post_ID').val();
|
var tempID = jQuery('#post_ID').val();
|
||||||
var postID = parseInt( res.responses[0].id );
|
var postID = parseInt( res.responses[0].id );
|
||||||
autosave_update_post_ID( postID );
|
autosave_update_post_ID( postID );
|
||||||
if ( tempID < 0 ) // update media buttons
|
if ( tempID < 0 && postID > 0) // update media buttons
|
||||||
jQuery('#media-buttons a').each(function(){
|
jQuery('#media-buttons a').each(function(){
|
||||||
this.href = this.href.replace(tempID, postID);
|
this.href = this.href.replace(tempID, postID);
|
||||||
});
|
});
|
||||||
|
|
|
@ -47,7 +47,7 @@ class WP_Scripts {
|
||||||
'broken' => __('An unidentified error has occurred.')
|
'broken' => __('An unidentified error has occurred.')
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080326' );
|
$this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080326b' );
|
||||||
|
|
||||||
$this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
|
$this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
|
||||||
$this->localize( 'wp-ajax', 'WPAjaxL10n', array(
|
$this->localize( 'wp-ajax', 'WPAjaxL10n', array(
|
||||||
|
|
Loading…
Reference in New Issue