Index: wp-admin/post-new.php =================================================================== --- wp-admin/post-new.php (revision 14017) +++ wp-admin/post-new.php (working copy) @@ -29,16 +29,9 @@ $title = sprintf(__('Add New %s'), $post_type_object->singular_label); $editing = true; -wp_enqueue_script('autosave'); -wp_enqueue_script('post'); -if ( user_can_richedit() ) - wp_enqueue_script('editor'); -add_thickbox(); -wp_enqueue_script('media-upload'); -wp_enqueue_script('word-count'); if ( 'post' == $post_type && !current_user_can('edit_posts') ) { - require_once ('./admin-header.php'); ?> + include('admin-header.php'); ?>
edit_posts capability to your user, in order to be authorized to post.
You can also e-mail the admin to ask for a promotion.
@@ -50,6 +43,8 @@
exit();
}
+wp_enqueue_script('autosave');
+
// Show post form.
if ( current_user_can($post_type_object->edit_type_cap) ) {
$post = get_default_post_to_edit( $post_type, true );
@@ -58,4 +53,4 @@
}
include('admin-footer.php');
-?>
+
Index: wp-admin/post.php
===================================================================
--- wp-admin/post.php (revision 14017)
+++ wp-admin/post.php (working copy)
@@ -170,15 +170,6 @@
$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 @@
$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;
Index: wp-admin/edit-form-advanced.php
===================================================================
--- wp-admin/edit-form-advanced.php (revision 14017)
+++ wp-admin/edit-form-advanced.php (working copy)
@@ -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