Introduce API to add back the description field in the new media popup.

Props nacin
fixes #22642


git-svn-id: https://develop.svn.wordpress.org/trunk@22929 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-11-29 23:52:30 +00:00
parent a792f59b19
commit cdce6a366e
3 changed files with 10 additions and 2 deletions
+4
View File
@@ -1899,6 +1899,10 @@ function wp_ajax_save_attachment_compat() {
if ( 'attachment' != $post['post_type'] )
wp_send_json_error();
// Handle the description field automatically, if a plugin adds it back.
if ( isset( $attachment_data['post_content'] ) )
$post['post_content'] = $attachment_data['post_content'];
$post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
if ( isset( $post['errors'] ) ) {