Can someone help with wp_enqueue_script?
-
I’ve read most of the posts on this forum about wp_enqueue_script, but I’m just not getting it.
I’m just trying to write a pretty simple plugin. Here is what I have going.
I’m using a class to write the plugin. This works, I can install the plugin and some db tables that go along with it.On one of the admin pages I want to use a jquery script so I’m thinking that I need to do this:
wp_enqueue_script('ht-dynanmic-form', plugins_url('wp-hobby-tracker/js/jquery-dynamic-form.js'), array( 'jquery', 'jquery-ui'),'1.0', true);
From what I have read, this should initiate jquery and jquery-ui, and then put the script tag in the footer of my page. I can’t find any reference when I search through the page source however.
Here is a quick and dirty overview of my plugin thus far. Obviously not the working code, but it should give you an idea.
if !class then create the class{ functions to generate pages and do stuff{} } function to add dbstuff{} function admin menus{ add_menu_page add_submenu_page wp_enqueue_script is here} register_activation_hook(__FILE__,'dbstuff'); add_action('admin_menu','admin menus');
Thanks for any help or advice.
Chuck
- The topic ‘Can someone help with wp_enqueue_script?’ is closed to new replies.