• topminds

    (@topminds)


    Hello,

    I’m trying to get the current profile user id. I have read the developer documentation guides and experimented with
    $profile_id = um_profile_id();
    $display_name = um_user(‘display_name’);
    echo um_get_display_name( $user_id );

    I am trying to create an if function whereby if (current user profile = sampleuserprofile), then some code is executed

    For instance (this did not work)
    if (um_user(‘display_name’) = “jack”) {
    echo do_shortcode XX
    }

    I know that the best way to do it would be to if ($user_id= ????) { echo shortcode}, but i cant find specific users’ ids.

    Would it be possible to firstly get a function to get current profile id, then check if that profile id is equal to a specific user id?

    Thank you so much for your help.

  • The topic ‘getting current profile’s user id’ is closed to new replies.