Registering a Custom Trigger
If you would like to add a custom trigger, you may do so using the tml_notifications_register_trigger()
function. Let's say you want to send a notification when a user is deleted. Consider the following code:
function register_custom_tml_notification_triggers() { tml_notifications_register_trigger( 'user_deleted', array( 'label' => __( 'User Deleted', 'theme-my-login-notifications' ), 'hook' => 'delete_user', ) ); } add_action( 'init', 'register_custom_tml_notification_triggers' );<br>
Note
Whichever action hook you use for the
Whichever action hook you use for the
hook
parameter should pass a user ID for the first parameter.