Problem with using admin_head in my plugin

Discussion in 'WordPress' started by Devtard, Nov 16, 2012.

  1. #1
    I need to put a HTML code (meta redirect) to the <head> section in my WP admin after a user submits a form and certain conditions are met. Unfortunately it seems that using add_action('admin_head', 'my_custom_admin_head'); doesn't work if I put it in the function used for printing my options page.

    If it is anywhere else, it works, but then I would have to add an option to a database and constantly check it for changes to determine if the script is allowed put the redirect code to <head>.

    Isn't there a way to achieve this in a simpler way?
    When I just use header() or wp_redirect() I get the "headers already sent" error.

    Thanks.
     
    Devtard, Nov 16, 2012 IP