• Resolved legalmartin

    (@legalmartin)


    Hello,

    How can I display the user email address on all pages’ main menu when this particular user is logged in?

    Regards.

    Martin

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

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

    (@aswingiri)

    Hello @legalmartin

    You can use menu short tag on menu as explained on this article.

    By default email is not available on menu short tag, you can add following code snippets to your site:

    add_filter( 'um_allowed_user_tags_patterns', function( $pattern_array ){
        $pattern_array[] = '{email}';
        return $pattern_array;
    });
    
    add_filter( "um_profile_tag_hook__email", function( $value, $user_id ){
        $value = um_user( 'user_email' );
        return $value;
    },10,2);

    You add this code using the ‘code snippets‘ plugin or just add it to your theme’s functions.php

    Thread Starter legalmartin

    (@legalmartin)

    Thank you – I will try and revert.

    Thread Starter legalmartin

    (@legalmartin)

    Works nicely – Thank you very much.

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Thanks for letting us know how it resolved the issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display user email address on all pages when this user is logged in’ is closed to new replies.