Is it possible to remove this action? (as it’s added just before it’s called)

In wp-signup.php there are these lines:

add_action( 'wp_head', 'wpmu_signup_stylesheet' );
get_header();

I need to remove wpmu_signup_stylesheet from the wp_head action, but I seem to be struggling, I assume it is because the action is being called straight after.

Here is what I’ve tried from a plugin:

// Called from an action that is added with:
// add_action('wp_head', array($this, 'remove_signup_style', 11));
remove_action( 'wp_head', 'wpmu_signup_stylesheet');

3 Answers
3

The action is not right after actually. There is get_header() call, then get_header action and then locating and loading template file that has wp_head() in it.

I try not to mess with removing things from inside of same hook you are at, so in this case I’d (ab)use that get_header action to hook function that will remove what you don’t want from later wp_head.

Leave a Comment