• Hello,
    i want to do some things programmatically when admin wants to approve membership for a user.
    I saw that a hook named um_after_user_is_approved exists.
    I used it and it works but it is not exactly what i want because it fires after approvement.

    Is there a hook that fires before approvement?

    I want to do some actions there and if it is a problem or false, cancel the approvement and don’t approve the user.

    Is there another hook or can i do something with this hook?
    I tried return false and redirect and nothing worked.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • @gioiliop7

    You can look at these hooks fired at UM bulk user action in WP Users backend.
    These hooks are found in /includes/admin/core/class-admin-users.php

    /**
    					 * UM hook
    					 *
    					 * @type action
    					 * @title um_admin_user_action_hook
    					 * @description Action on bulk user action
    					 * @input_vars
    					 * [{"var":"$bulk_action","type":"string","desc":"Bulk Action"}]
    					 * @change_log
    					 * ["Since: 2.0"]
    					 * @usage add_action( 'um_admin_user_action_hook{$action}', 'function_name', 10, 1 );
    					 * @example
    					 * <?php
    					 * add_action( 'um_admin_user_action_hook', 'my_admin_user_action', 10, 1 );
    					 * function my_admin_user_action( $bulk_action ) {
    					 *     // your code here
    					 * }
    					 * ?>
    					 */
    					do_action( 'um_admin_user_action_hook', $bulk_action );
    
    					/**
    					 * UM hook
    					 *
    					 * @type action
    					 * @title um_admin_user_action_{$bulk_action}_hook
    					 * @description Action on bulk user action
    					 * @change_log
    					 * ["Since: 2.0"]
    					 * @usage add_action( 'um_admin_user_action_{$bulk_action}_hook', 'function_name', 10 );
    					 * @example
    					 * <?php
    					 * add_action( 'um_admin_user_action_{$bulk_action}_hook', 'my_admin_user_action', 10 );
    					 * function my_admin_user_action() {
    					 *     // your code here
    					 * }
    					 * ?>
    					 */
    					do_action( "um_admin_user_action_{$bulk_action}_hook" );
    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hook pre_user_approved?’ is closed to new replies.