Add scripts to head section of a plugin file
-
Hi people,
I need to add a javascript to the head of a file that i use in the plugin..
Please note that the file is a part of my form.. so i don’t have added it as a sub menu to my plugin menu.. So i start at a page with the main form then submit and it will display another form and so on..
Now i need to add javascript to the third form..
i think i have todo it with:
function register_extra_settings_head() { require_once('forms/extra-settings-head.php'); } add_action('admin_head-PLUGIN_NAME_DIRECTORY/forms/extra-settings.php', 'register_extra_settings_head');
i tried the above but it didn’t work.. i guess the paths aren’t correct?
The file with the above code is in the root.. then i got a folder forms where the extra-settings and extra-settings-head is..
BTW! When i submit a form i check if it is correct in ANOTHER file and then i do
require(next_form.php)
and so on.. so is it even possible to add it, or do i need to add it all to the head of the file where i require the forms? Because that file is added as the main page of the plugin..Any idea what i’m doing wrong?
Thanks!
- The topic ‘Add scripts to head section of a plugin file’ is closed to new replies.