您可以在functions.php
:
function add_admin_scripts( $hook ) {
if ( $hook == \'post-new.php\' ) {
wp_enqueue_script( \'myscript\', get_bloginfo(\'template_directory\').\'/js/myscript.js\' );
}
}
add_action(\'admin_enqueue_scripts\',\'add_admin_scripts\',10,1);