mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
+5
-9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user