WordPress.org

Make WordPress Core

Ticket #22642: 22642.3.diff

File 22642.3.diff, 2.1 KB (added by nacin, 5 years ago)
  • wp-includes/media.php

     
    13881388        }
    13891389
    13901390        if ( function_exists('get_compat_media_markup') )
    1391                 $response['compat'] = get_compat_media_markup( $attachment->ID, array( 'taxonomies' => true ) );
     1391                $response['compat'] = get_compat_media_markup( $attachment->ID, array( 'taxonomies' => true, 'description' => true ) );
    13921392
    13931393        return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );
    13941394}
  • wp-admin/includes/ajax-actions.php

     
    18991899        if ( 'attachment' != $post['post_type'] )
    19001900                wp_send_json_error();
    19011901
     1902        // Handle the description field automatically, if a plugin adds it back.
     1903        if ( isset( $attachment_data['post_content'] ) )
     1904                $post['post_content'] = $attachment_data['post_content'];
     1905
    19021906        $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
    19031907
    19041908        if ( isset( $post['errors'] ) ) {
  • wp-admin/includes/media.php

     
    12871287        $default_args = array(
    12881288                'errors' => null,
    12891289                'taxonomies' => false,
     1290                'description' => false,
    12901291        );
    12911292
    12921293        $args = wp_parse_args( $args, $default_args );
     
    13251326        $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
    13261327
    13271328        unset( $form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'],
    1328                 $form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'],
     1329                $form_fields['post_title'], $form_fields['post_excerpt'],
    13291330                $form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] );
    13301331
     1332        if ( ! $args['description'] )
     1333                unset( $form_fields['post_content'] );
     1334
    13311335        $media_meta = apply_filters( 'media_meta', '', $post );
    13321336
    13331337        $defaults = array(