• Resolved mkstebbins

    (@mkstebbins)


    Perhaps there is a setting I’m missing after updating to 2.2.0

    Use of hook um_before_submit_form_post worked well before 2.2.0. After 2.2.0, the following code yields no values.

    add_action('um_before_submit_form_post', 'user_updated_profile', 10, 1 );
    
    function user_updated_profile( $post ) {
            $userData = get_userdata(um_user('ID') );
            echo "Email is " . $userData->user_email;
            echo "User changed form " . $post['form_id'];
            if( $post['form_id'] == 9999 ) $actionOnForm = "$userData->first_name $userData->last_name Filled out blablabla form ";
     ...
     

    Perhaps there is a setting or change in syntax required with 2.2.0 to see these values again. Thank you for any pointers.

    -Michael

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @mkstebbins

    We’ve removed the parameter of that action hook. You can catch the submitted data with $_POST. Or you can assign it to $post variable. e.g. $post = $_POST

    add_action('um_before_submit_form_post', 'user_updated_profile', 10 );
    function user_updated_profile() {
            $post = $_POST
            $userData = get_userdata(um_user('ID') );
            echo "Email is " . $userData->user_email;
            echo "User changed form " . $post['form_id'];
    }
    

    Regards,

    Thread Starter mkstebbins

    (@mkstebbins)

    Thanks @champsupertramp and very nice to add the code example.

    That did the trick and it works well now.

    I scanned the documentation and release notes for an answer before posting here. Is there a better place I can find changes like this for future updates?

    Thanks again,

    -Michael

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @mkstebbins

    Sorry, We’ve missed it and forgot to add it in the readme. It should be in the readme.txt file.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘2.2.0 stopped my use of um_before_submit_form_post with $post on form changes’ is closed to new replies.