• Resolved Yavor Simeonov

    (@simeonovy)


    Hello, after a user edits or adds data about himself, there is no message for successful editing. Even if you add js code, according to the documentation of the plugin, it does not work, because the plugin, after editing the profile, does not redirect to “?update= ne6to-si”, but simply back to the dashboard. What is the solution to this?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    Hello @simeonovy,

    You can try adding the following codes in your theme’s functions.php, and you can style the message as per your desire.

    add_action( ‘um_after_user_updated’, ‘my_after_user_updated’, 1, 3 );
    function my_after_user_updated( $user_id, $args, $userinfo ) {
    update_user_meta( $user_id,’_um_notify_profile_update’,time());
    }
    add_action( ‘um_before_form’,function( $args ){
    $current_user_id = get_current_user_id();
    $profile_id = um_profile_id();
    $update_notification = get_user_meta($profile_id ,’_um_notify_profile_update’,true);
    if( $update_notification && $profile_id == $current_user_id ):
    ?>
    <div style=”background:rgba(0,0,0,0.5);padding:5px;text-align:center;color:#fff;width:100%;”>Profile Updated.</div>
    <?php
    delete_user_meta( $profile_id,’_um_notify_profile_update’ );
    endif;
    });

    I tried it and seems to work fine.

    @aswingiri

    You must use the “CODE” formatting when you display code in the forum!

    Plugin Support Aswin Giri

    (@aswingiri)

    @missveronicatv Yes, I figured that but code formatting is mostly added automatically when code is pasted but it didn’t this time. Since I can’t edit it now, I am just adding the codes again.

    add_action( ‘um_after_user_updated’, ‘my_after_user_updated’, 1, 3 );
    function my_after_user_updated( $user_id, $args, $userinfo ) {
    update_user_meta( $user_id,’_um_notify_profile_update’,time());
    }
    add_action( ‘um_before_form’,function( $args ){
    $current_user_id = get_current_user_id();
    $profile_id = um_profile_id();
    $update_notification = get_user_meta($profile_id ,’_um_notify_profile_update’,true);
    if( $update_notification && $profile_id == $current_user_id ):
    ?>
    <div style=”background:rgba(0,0,0,0.5);padding:5px;text-align:center;color:#fff;width:100%;”>Profile Updated.</div>
    <?php
    delete_user_meta( $profile_id,’_um_notify_profile_update’ );
    endif;
    });

    @aswingiri

    With the result PHP errors again
    because you copied the bad code from above,
    copy from your PHP text editor!!!

    This is not accepted by PHP ‘um_after_user_updated’

    • This reply was modified 3 years, 3 months ago by missveronica.
    Plugin Support Aswin Giri

    (@aswingiri)

    @missveronicatv you might want to copy the code from the first reply. Once the code is formatted to “CODE”, it changes a single quotation. You can also view and copy this code at: https://codeshare.io/zylD3N

    • This reply was modified 3 years, 3 months ago by Aswin Giri.
    Thread Starter Yavor Simeonov

    (@simeonovy)

    And the right solution is?

    Plugin Support Aswin Giri

    (@aswingiri)

    @simeonovy You can copy codes from https://codeshare.io/zylD3N and paste them to your theme’s functions.php

    That should work for you.

    @simeonovy

    I have tested this code:

    
        add_action( 'um_after_user_updated', 'my_after_user_updated', 1, 3 );
            
            function my_after_user_updated( $user_id, $args, $userinfo ) {
                
                update_user_meta( $user_id, '_um_notify_profile_update', time());
            }
    
        add_action( 'um_before_form', function( $args ) {
    
            $current_user_id = get_current_user_id();
            $profile_id = um_profile_id();
            $update_notification = get_user_meta( $profile_id , '_um_notify_profile_update', true );
            
            if( $update_notification && $profile_id == $current_user_id ) {
    
                echo '<div style=”background:rgba(0,0,0,0.5);padding:5px;text-align:center;color:#fff;width:100%;”>Profile Updated.</div>';
    
                delete_user_meta( $profile_id, '_um_notify_profile_update' );
            }
        });
    
    Thread Starter Yavor Simeonov

    (@simeonovy)

    I can’t explain to our clients how it is possible that there is no such message for successful changes – that’s pretty stupid!

    Plugin Support Aswin Giri

    (@aswingiri)

    @simeonovy

    Plugin does not have success message feature but you can try the code snippet I provided on codeShare link https://codeshare.io/zylD3N , it works for your requirement. You can also check the screenshot here https://prnt.sc/1mzgi98

    Thread Starter Yavor Simeonov

    (@simeonovy)

    Thanks for the code to work, but the problem is that the redirect after “Update data” is not directed to the same dashboard to display the message. As I mentioned in my main query – URL, for example “?update = ne6to-si”

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @simeonovy

    Did you add the UM Profile form to another page? Is it different from the Profile form added to the /user/ page?

    Regards,

    Thread Starter Yavor Simeonov

    (@simeonovy)

    I’m sorry, but I didn’t understand your question?

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @simeonovy

    You said in the previous reply “but the problem is that the redirect after “Update data” is not directed to the same dashboard to display the message. ”

    Which page did you add the UM Profile form shortcode? Is it on a different page or on the UM user page? You can check the UM User page set in WP Admin > Ultimate Member > Settings > General > Pages > see User page.

    Regards,

    Thread Starter Yavor Simeonov

    (@simeonovy)

    User page there is “Account”

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘No message to successfully edit user data’ is closed to new replies.