add_action into another add_action not working
The preferred method of creating a settings page is to use the WordPress Settings API. From your code example, it looks like it’s too late to remove the admin_notices hook inside your callback in the admin_menu hook. You should try to move the logic from the customfunc() callback into another callback activated from some earlier … Read more