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:
Mark Jaquith 2008-03-26 21:00:21 +00:00
parent bfc779927b
commit f7c21d131d
3 changed files with 5 additions and 3 deletions

View File

@ -644,10 +644,12 @@ function get_media_item( $attachment_id, $args = null ) {
$toggle_links = '';
}
$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
$item = "
$type
$toggle_links
<div class='filename new'>$filename</div>
<div class='filename new'>$display_title</div>
<table class='slidetoggle describe $class'>
<tbody class='media-item-info'>
<tr>

View File

@ -53,7 +53,7 @@ function autosave_saved_new(response) {
var tempID = jQuery('#post_ID').val();
var postID = parseInt( res.responses[0].id );
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(){
this.href = this.href.replace(tempID, postID);
});

View File

@ -47,7 +47,7 @@ class WP_Scripts {
'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->localize( 'wp-ajax', 'WPAjaxL10n', array(