0
votes

I have created a Plugin for the Wordpress Admin Panel. It creates a menu and a submenu. In the submenu Page I want to add jquery. How do I do that?

1

1 Answers

2
votes

Use something like this in your function called by the add_submenu_page for that submenu

example:

public function function_called_from_add_submenu_page() {
     $jquery_path = 'https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js';
     wp_register_script('cdnjquery', $jquery_path);
     wp_enqueue_script('cdnjquery');
}

See: http://codex.wordpress.org/Function_Reference/add_submenu_page

See: http://codex.wordpress.org/Function_Reference/wp_register_script

See: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Hope this helps.