Make WordPress Core


Ignore:
Timestamp:
04/16/2010 02:03:48 PM (14 years ago)
Author:
nacin
Message:

Don't enqueue unnecessary scripts when the post type doesn't support the editor. fixes #12590, props scribu, _duck.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post.php

    r13242 r14107  
    171171    }
    172172
    173     wp_enqueue_script('post');
    174     if ( user_can_richedit() )
    175         wp_enqueue_script('editor');
    176     add_thickbox();
    177     wp_enqueue_script('media-upload');
    178     wp_enqueue_script('word-count');
    179     wp_enqueue_script( 'admin-comments' );
    180     enqueue_comment_hotkeys_js();
    181 
    182173    if ( $last = wp_check_post_lock( $post->ID ) ) {
    183174        add_action('admin_notices', '_admin_notice_post_locked' );
     
    189180    $title = sprintf(__('Edit %s'), $post_type_object->singular_label);
    190181    $post = get_post_to_edit($post_id);
     182
     183    if ( post_type_supports($post_type, 'comments') ) {
     184        wp_enqueue_script('admin-comments');
     185        enqueue_comment_hotkeys_js();
     186    }
    191187
    192188    include('edit-form-advanced.php');
Note: See TracChangeset for help on using the changeset viewer.