Skip to:
Content
Pages
Categories
Search
Top
Bottom

User ID


  • thedark52
    Participant

    @thedark52

    Hello,
    Is there a plugin that allows you to show a numeric User ID in the User Profile and in the “Users” section on the administration panel?

    I would like each user to correspond to a User ID that he can use to request assistance.

Viewing 3 replies - 1 through 3 (of 3 total)

  • Bit Boy
    Participant

    @bitboy

    Hello,
    You can use this plugin for showing the ID in the dashboard.

    Show IDs by 99 Robots

    and you may add following code to your theme’s functions.php to show the ID on user profile when the user is viewing his/her own profile or it is being viewed by the site admin.

    
    
    /**
     * Show User ID on a user's profile to the profile owner or Administrator.
     */
    function bidboy_show_displayed_user_id() {
    	if ( bp_is_my_profile() || is_super_admin() ) {
    		echo 'ID: ' . bp_displayed_user_id();
    	}
    }
    
    add_action( 'bp_before_member_header_meta', 'bidboy_show_displayed_user_id' );
    
    

    Best Regards
    B


    thedark52
    Participant

    @thedark52

    Thanks for the reply!

    None of your methods shows the ID to the user, but only shows it on the “All Users” page in wp-admin.

    I would also like the user to see his ID in his profile so that he can tell us if he needs help with that account.


    Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    The code bitboy provided works fine with the nouveau template, if you are using the legacy template then try this code:

    function ps_show_displayed_user_id() {
    	if ( bp_is_my_profile() || is_super_admin() ) {
    		echo 'ID: ' . bp_displayed_user_id();
    	}
    }
    
    add_action( 'bp_profile_header_meta', 'ps_show_displayed_user_id' );

    Please try to mention your template pack when asking for such kind of help in the forum, because the hooks differ in both the templates, that will also help us to help you better.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar