How to remove action from plugin?

You want:

remove_action('um_post_registration_approved_hook', 'um_post_registration_approved_hook', 10, 2);

… to run after the original add_action, but before the action triggers the function um_post_registration_approved_hook

The easiest way to do this, but I haven’t tested it, might be to just give your removal an earlier priority on the same hook:

add_action( 'um_post_registration_approved_hook', 'remove_my_action', 9 );
function remove_my_action(){
    remove_action('um_post_registration_approved_hook', 'um_post_registration_approved_hook', 10, 2);
}

This is what you were trying, but the priority was the wrong way around. 11 runs after 10.

Leave a Comment