Support » Plugin: User Meta - User Profile Builder and User management plugin » user_meta_after_user_update for $formName

  • Resolved Gronix

    (@gronix)


    Hi! How to use add_action user_meta_after_user_update for some the $formName?

    My code does not work:

    add_action( ‘user_meta_after_user_update’, ‘user_meta_after_user_update_function’ );
    function user_meta_after_user_update_function( $response ){
    global $userMeta;
    if ($formName == “formname”){
    echo $userMeta->jsRedirect( ‘http://test.com’ );
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sourov Amin

    (@sourov)

    Hello,

    You are missing the form name parameter.
    Try:

    add_action( "user_meta_after_user_update", "user_meta_after_user_update_function", 10, 2 );
        
    function user_meta_after_user_update_function( $response, $formName ){
        global $userMeta;
        if ( $formName == "formname" ){
            echo $userMeta->jsRedirect( "http://test.com" );
        }
    }

    That should do the job.

    Thanks.

    It works!! 🙂 Thank You!!

    How can I debug user_meta_after_user_update?

    I’ve added the very same code above (with and without the form name check) and I do not get a redirect. I’ve tried having the function log or error out or mail() me. I get nothing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘user_meta_after_user_update for $formName’ is closed to new replies.