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

git-svn-id: https://develop.svn.wordpress.org/trunk@14107 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-04-16 14:03:48 +00:00
parent 25a910c025
commit e3e9a8e5c8
3 changed files with 25 additions and 21 deletions
+13
View File
@@ -10,6 +10,19 @@
if ( !defined('ABSPATH') )
die('-1');
wp_enqueue_script('post');
if ( post_type_supports($post_type, 'editor') ) {
if ( user_can_richedit() )
wp_enqueue_script('editor');
wp_enqueue_script('word-count');
}
if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
add_thickbox();
wp_enqueue_script('media-upload');
}
/**
* Post ID global
* @name $post_ID