如果您有条件地想为您的帖子类型加载任何脚本,那么下面的内容可能会很有用。
function my_enqueue($hook) {
global $current_screen;
/* Check if the post being added/edited is a Custom Post Type which you want */
if ( ( \'post.php\' == $hook || \'post-new.php\' == $hook ) && \'hire\' == $current_screen->post_type )
wp_enqueue_script( \'my_custom_script\', plugin_dir_url( __FILE__ ) . \'/js/myscript.js\' );
}
add_action( \'admin_enqueue_scripts\', \'my_enqueue\' );