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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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'] ) {
|
||||
|
||||
Reference in New Issue
Block a user