Make WordPress Core

Changeset 22929


Ignore:
Timestamp:
11/29/2012 11:52:30 PM (12 years ago)
Author:
ryan
Message:

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

Props nacin
fixes #22642

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r22869 r22929  
    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
  • trunk/wp-admin/includes/media.php

    r22872 r22929  
    12881288        'errors' => null,
    12891289        'taxonomies' => false,
     1290        'description' => false,
    12901291    );
    12911292
     
    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'] );
     1331
     1332    if ( ! $args['description'] )
     1333        unset( $form_fields['post_content'] );
    13301334
    13311335    $media_meta = apply_filters( 'media_meta', '', $post );
  • trunk/wp-includes/media.php

    r22920 r22929  
    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 );
Note: See TracChangeset for help on using the changeset viewer.