下面是在管理页面上加载自定义脚本的代码
function wpse60745_loadto_admin() {
// to load styles
wp_register_style( \'my_plugin_css\', plugins_url(\'plugin-style.css\', __FILE__) );
wp_enqueue_style( \'my_plugin_css\' );
//to load javascripts
wp_register_script( \'my_plugin_js\', plugins_url(\'plugin.js\', __FILE__) );
wp_enqueue_script( \'my_plugin_js\' );
}
add_action(\'admin_enqueue_scripts\', \'wpse60745_loadto_admin\');
更新上述代码
Reference