2012-05-02 85 views
1

我在我的插件中使用wordpress mediaupload功能。如何加載jQuery總是在頁面頂部的WordPress的

Error: jQuery is not defined 
Source File: http://localhost/my_wp/wp-admin/load-scripts.php?c=0&load=utils,thickbox,media-upload&ver=4ec4a484079ac4122099967c5457437d 
Line: 19 

這是我的錯誤消息,當我的插件加載。當我看到代碼媒體上傳腳本首先加載然後jquery加載。 這是我的代碼

add_action('admin_enqueue_scripts', 'wpvote_include_files'); 
function wpvote_include_files() { 
    wp_deregister_script('jquery'); 
    wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'); 
    wp_enqueue_script('jquery'); 

wp_enqueue_script('media-upload'); 
    wp_enqueue_script('thickbox'); 
    wp_register_script('my-upload', WPVOTE_PLUGIN_URL.'wpmediaupload_scripts.js', array('jquery','media-upload','thickbox')); 
    wp_enqueue_script('my-upload'); 

} 

這是我的網頁源代碼

<script type='text/javascript' src='http://localhost/my_wp/wp-admin/load-scripts.php?c=0&amp;load=utils,thickbox,media-upload&amp;ver=4ec4a484079ac4122099967c5457437d'></script> 
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?ver=3.3.2'></script> 

回答

相關問題