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
+5 -9
View File
@@ -170,15 +170,6 @@ case 'edit':
$submenu_file = "edit.php?post_type=$post_type";
}
wp_enqueue_script('post');
if ( user_can_richedit() )
wp_enqueue_script('editor');
add_thickbox();
wp_enqueue_script('media-upload');
wp_enqueue_script('word-count');
wp_enqueue_script( 'admin-comments' );
enqueue_comment_hotkeys_js();
if ( $last = wp_check_post_lock( $post->ID ) ) {
add_action('admin_notices', '_admin_notice_post_locked' );
} else {
@@ -189,6 +180,11 @@ case 'edit':
$title = sprintf(__('Edit %s'), $post_type_object->singular_label);
$post = get_post_to_edit($post_id);
if ( post_type_supports($post_type, 'comments') ) {
wp_enqueue_script('admin-comments');
enqueue_comment_hotkeys_js();
}
include('edit-form-advanced.php');
break;