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');
The action is not right after actually. There is
get_header()
call, thenget_header
action and then locating and loading template file that haswp_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 laterwp_head
.Thanks for the tip @Rarst! Working code below.
Try adding a priority:
p.s. is the
add_action()
call really placed beforeget_header()
, or is it placed beforewp_head()
? I’m not sure it really matters, so long aswp_head()
is included inheader.php
; but that’s just an unusual place to add anadd_action()
call.