• Resolved daveuk

    (@daveuk)


    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>’;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter daveuk

    (@daveuk)

    sorry I didnt finish a sentence in the above post…

    … I get an error telling me the headers can not be modifid because they have already been written.

    Thread Starter daveuk

    (@daveuk)

    I think this must have been some sort of funny character in my plug-in somewhere because it mysteriously went away when I reshuffled the file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need to determine if an action is being called by the admin site (is_admin?)’ is closed to new replies.