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/edit-form-advanced.php

    r14106 r14107  
    1010if ( !defined('ABSPATH') )
    1111    die('-1');
     12
     13wp_enqueue_script('post');
     14
     15if ( post_type_supports($post_type, 'editor') ) {
     16    if ( user_can_richedit() )
     17        wp_enqueue_script('editor');
     18    wp_enqueue_script('word-count');
     19}
     20
     21if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
     22    add_thickbox();
     23    wp_enqueue_script('media-upload');
     24}
    1225
    1326/**
Note: See TracChangeset for help on using the changeset viewer.