• Resolved lianqing

    (@lianqing)


    Is there a way to get the approval status of the user using php (for example: approved, awaiting email confirmation, etc.)

    Also, can the program detect successful account activation? (email verification succeed)

    Thank you

    • This topic was modified 3 years, 9 months ago by lianqing.
Viewing 3 replies - 1 through 3 (of 3 total)
  • @lianqing

    Is there a way to get the approval status of the user using php (for example: approved, awaiting email confirmation, etc.)

    Yes, you have many examples in /includes/core/class-user.php

    Also, can the program detect successful account activation? (email verification succeed)

    Yes, by using these hooks in /includes/core/class-user.php

    /**
     * UM hook
     *
     * @type action
     * @title um_after_user_status_is_changed_hook
     * @description Action after user status changed
     * @input_vars
     * [{"var":"$user_id","type":"int","desc":"User ID"}]
     * @change_log
     * ["Since: 2.0"]
     * @usage add_action( 'um_after_user_status_is_changed_hook', 'function_name', 10 );
     * @example
     * <?php
     * add_action( 'um_after_user_status_is_changed_hook', 'my_after_user_status_is_changed', 10 );
     * function my_after_user_status_is_changed() {
     *     // your code here
     * }
     * ?>
     */
    do_action( 'um_after_user_status_is_changed_hook', um_user( 'ID' ) );
    
    /**
     * UM hook
     *
     * @type action
     * @title um_after_user_status_is_changed
     * @description Action after user status changed
     * @input_vars
     * [{"var":"$status","type":"string","desc":"User Status"},
     *  {"var":"$user_id","type":"integer","desc":"User ID"}]
     * @change_log
     * ["Since: 2.0"]
     * @usage add_action( 'um_after_user_status_is_changed', 'function_name', 10, 1 );
     * @example
     * <?php
     * add_action( 'um_after_user_status_is_changed', 'my_after_user_status_is_changed', 10, 1 );
     * function my_after_user_status_is_changed( $status ) {
     *     // your code here
     * }
     * ?>
     */
    do_action( 'um_after_user_status_is_changed', $status, um_user( 'ID' ) );
    Thread Starter lianqing

    (@lianqing)

    Thank you! It works perfectly!

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @lianqing

    Thanks for letting us know how it resolved your issue.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get user approval status’ is closed to new replies.