WordPress.org

Ready to get started?Download WordPress

Forums

Get User ID from user admin page (2 posts)

  1. lotsamottsa
    Member
    Posted 4 months ago #

    Is there a way I can get another user ID or user name from their user profile page, when I am logged in as the admin?

    For instance, I am logged in as the admin, I am looking at a different user's profile. I want to get the id of the user's profile I am looking at, not my own.

    I've tried,

    $screen = get_current_screen();
    echo ($screen->ID);

    and a few variations of that, but that didn't work. Any ideas?

  2. lotsamottsa
    Member
    Posted 4 months ago #

    Actually, I should probably add that I used the Modify_contact_methods() filter:

    function modify_contact_methods($profile_fields) {
    $screen = get_current_screen();
    echo ($screen->ID);
    }
    add_filter('user_contactmethods', 'modify_contact_methods');

Reply

You must log in to post.

About this Topic