我已经阅读了之前所有关于这方面的帖子,但似乎无法理解我的代码有什么问题。这是我写的一个插件。我以为我已经把它分类了,但看起来我还没有。这是我叫这些的顺序吗?
function gedshow_ajaxurl() {
echo \'<script type="text/javascript">
var ajaxurl = "\' . admin_url(\'admin-ajax.php\') . \'";
</script>\';
}
add_action(\'wp_head\', \'gedshow_ajaxurl\');
wp_enqueue_script(\'jquery\');
add_action(\'admin_menu\', \'gedshow_setup_menu\');
function mw_enqueue_color_picker( $hook_suffix ) {
// first check that $hook_suffix is appropriate for your admin page
wp_enqueue_style( \'wp-color-picker\' );
wp_enqueue_script( \'my-script-handle\', plugins_url(\'my-script.js\', __FILE__ ), array( \'wp-color-picker\' ), false, true );
}
add_action( \'admin_enqueue_scripts\', \'mw_enqueue_color_picker\' );
function gedshow_enqueue_styles(){
$file_url = plugins_url(\'gedshow.css\',__FILE__);
wp_enqueue_style(\'sp_stylesheet\',$file_url);
}
add_action( \'wp_enqueue_scripts\',\'gedshow_enqueue_styles\');