I have added a new custom bulk action to the user listing page called Resend Welcome Email, it is showing and running. What I'm looking to do is fire the Resend Welcome Email plugin's action. I'm struggling to implement this... I have tried to use the add_action call of:
add_action ( 'resend_welcome_email', 20, $user );
But nothing seems to happen. It is possible to fire a plugin's action via this method? Is that how add_action works?
What I'm looking to do is talked about here but I can't figure out how to action what the plugin author is talking about.
Thanks, Adam
I have added a new custom bulk action to the user listing page called Resend Welcome Email, it is showing and running. What I'm looking to do is fire the Resend Welcome Email plugin's action. I'm struggling to implement this... I have tried to use the add_action call of:
add_action ( 'resend_welcome_email', 20, $user );
But nothing seems to happen. It is possible to fire a plugin's action via this method? Is that how add_action works?
What I'm looking to do is talked about here but I can't figure out how to action what the plugin author is talking about.
Thanks, Adam
Share Improve this question edited Feb 14, 2020 at 12:59 apalin asked Feb 14, 2020 at 11:52 apalinapalin 155 bronze badges1 Answer
Reset to default 1I don't think the plugin is helpful for your case, and you can just call the WordPress API yourself directly:
wp_new_user_notification( $user_id, null, 'both' );
This is all the plugin does: get's the user ID from request parameters, verifies the user exists and then calls wp_new_user_notifications (see plugin code here).