Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!

Merry Christmas and Happy Holidays! 🎄

wpForo 1.x.x [Closed] Current Logged-in User ID

10 Posts
4 Users
1 Reactions
4,647 Views
Posts: 9
Topic starter
(@darkness)
Active Member
Joined: 6 years ago

where do I add this code to show the active users profile? I've embed [wpforo item="profile" id="25"] its only showing my Profile page

Global $wpforo;
$current_user_id = get_current_user_id();
if( $current_user_id ) $forum_profile_url = $wpforo->member->get_profile_url( $current_user_id );   

9 Replies
Robert
Posts: 10600
Admin
(@robert)
Support Team
Joined: 10 years ago

Hi @darkness,

As far as i see. You don't need any code to get current user profile URLs, just use those URLs without specific user nickname and it'll automatically open current user profile pages:

 


5 Replies
(@darkness)
Joined: 6 years ago

Active Member
Posts: 9

@robert

Sorry I don't think you understand what I mean. I'm using the shortcode [wpforo item="profile" id="25"]  But I want it to load up the CURRENT user rather then a specific one. I want to do something like [wpforo item="profile" id="$user_id"] 


Robert
Admin
(@robert)
Joined: 10 years ago

Support Team
Posts: 10600

@darkness

Ok, I see you now. I'll try to find some solution for you...


(@darkness)
Joined: 6 years ago

Active Member
Posts: 9

@robert

that would be great thank you! sorry it didn't make any sense the first time.


(@darkness)
Joined: 6 years ago

Active Member
Posts: 9

moved to a different plugin because of no solution and doesn't meet my needs... Pretty stupid code to make a shortcode with only a specific user ID.. 


Robert
Admin
(@robert)
Joined: 10 years ago

Support Team
Posts: 10600

@darkness

Sorry to hear that. We've already started working on the current user shortcodes. So I hope you'll have an opportunity use it in future.

Thank you for trying wpForo!


Posts: 533
(@central4allgmail-com)
Prominent Member
Joined: 7 years ago

do you want to show all online users ?


2 Replies
(@darkness)
Joined: 6 years ago

Active Member
Posts: 9

@central4allgmail-com

no all I wanted to do was make the shortcode [wpforo item="profile" id="25"] get the current user rather then a specific one. Something like [wpforo item="profile" id="$user_id"] 


Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5637

@darkness

Please follow the steps: 

1. open the wp-content/plugins/wpforo/wpforo.php file 

2. find the following line

public function init_shortcode_page(){ 

3. put the code below before this line if( $args['id'] || $args['slug'] ){

if( $args['item'] === 'profile' && !$args['id'] ) $args['id'] = $this->current_userid;

Then just use the following shortcode:

[wpforo item="profile"]