Media: Add title, caption, and alt text, and attachment info to sidebar.

* Improve sidebar styles.
* Separate the hybrid title/caption field.
* Improve the sidebar image thumbnail.
* Remove filenames from inside the non-image icon thumbnail.
* Properly sync title/caption/alt.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith
2012-11-10 18:25:04 +00:00
parent e7767b1eba
commit 30e0a600bf
5 changed files with 244 additions and 127 deletions

View File

@@ -1858,8 +1858,11 @@ function wp_ajax_save_attachment() {
if ( ! empty( $changes['caption'] ) )
$args['post_excerpt'] = $changes['caption'];
if ( ! empty( $changes['alt'] ) )
$args['_wp_attachment_image_alt'] = $changes['alt'];
if ( $args )
wp_update_post( array_merge( $args, array( 'ID' => $id ) ) );
edit_post( array_merge( $args, array( 'post_ID' => $id ) ) );
wp_send_json_success();
}

View File

@@ -165,8 +165,9 @@ function edit_post( $post_data = null ) {
$post_data = _wp_translate_postdata( true, $post_data );
if ( is_wp_error($post_data) )
wp_die( $post_data->get_error_message() );
if ( 'autosave' != $post_data['action'] && 'auto-draft' == $post_data['post_status'] )
if ( ( empty( $post_data['action'] ) || 'autosave' != $post_data['action'] ) && 'auto-draft' == $post_data['post_status'] ) {
$post_data['post_status'] = 'draft';
}
if ( isset($post_data['visibility']) ) {
switch ( $post_data['visibility'] ) {