2014-05-11 68 views
0

我想添加一個插件,我正在嘗試爲WordPress開發插件。 表格應在管理員信息中心中可見。在wordpress插件中包含插件

我根本無法設法顯示錶格。

在Wordpress中是否存在一個運行handontable的通用障礙?

提前

回答

0

非常感謝你綁定你的.js用適當的方法(wp_register_script和wp_enqueue_script)文件?

你應該做的是這樣的:

// Registering the back-end scripts 
add_action('wp_enqueue_scripts', 'my_backend_content_scripts'); 


// ! Calling the back-end scripts 

function my_backend_content_scripts() { 

     if(is_admin()){ 
      // parameter (name, script_url, depencys, version, include in header) 
      wp_register_script('my_js', 'www.fullscript_url.com/handsontable.js', array('jquery'), null, true); 
      wp_enqueue_script('my_js');     

     }  

} 
+0

非常感謝您! 現在工作:-) – thowa

+0

幾乎和你一樣開心。因爲你在晚上沒有迴應... – ernstl