Need to determine if an action is being called by the admin site (is_admin?)
-
Hi
I am developing my very first plug-in which is extremely simple and yet I have managed to bugger it up ??
I have hooked wp_head so I can insert a new script tag into every page header and it works for the main site but when the plugin is activated on the admin side I get an error telling me the
Now, I dont actually want the script included for admin pages so what I would like is some sort of function like is_admin() but i have searched this page (https://codex.www.ads-software.com/Conditional_Tags) and there seems to be nothing.
Thanks in advance
The full code for my plug in is below for reference:
add_action(‘wp_head’, ‘add_mint_javascript’);
function add_script($unused) {
echo ‘<script src=”/my.js” type=”text/javascript”></script>’;
}
- The topic ‘Need to determine if an action is being called by the admin site (is_admin?)’ is closed to new replies.