AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Closed] Link to User's profile page

8 Posts
2 Users
2 Reactions
8,197 Views
Robert
Posts: 10747
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 3 months ago

Thank you wolfpup64,

there was a wrong variable name, i just updated, please use the updated code.


wolfpup64
Posts: 19
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@wolfpup64)
Eminent Member
Joined: 10 years ago

Oh sorry man, I realized I actually screwed up. Because I'm trying to link from a user's BuddyPress profile to the same user's wpForo page, I actually need a way to link from the currently displayed user's page. I'm a total noob at this stuff. I managed to create the tab by bogarting some code from some other support page, however the link is directed by a slug and if I remove the slug the whole tab disappears. It took me a while to find something that worked. Heres the code I'm using, located in mu-plugin:

function add_communityprofile_tab() {
	global $bp;
	
	bp_core_new_nav_item( array(
		'name'                  => 'Community',
		'slug'                  => 'communityprofile',
		'parent_url'            => $bp->displayed_user->domain,
		'parent_slug'           => $bp->profile->slug,
		'screen_function'       => 'communityprofile_screen',			
		'position'              => 200,
		'default_subnav_slug'   => 'communityprofile'

add_action( 'bp_setup_nav', 'add_communityprofile_tab', 100 );

and I tried using this bit to link up to the wpForo page:

function communityprofile_screen() {
   bp_core_redirect( site_url( '/community/profile/'.bp_displayed_user_username() ) );

But it just links up to the wpForo main site page.

 

The url of the BuddyPress profile pages is: 

http://localhost/wordpress/users/*username*/profile/

What I'm trying to link up to is:

http://localhost/wordpress/community/profile/*username*


wolfpup64
Posts: 19
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@wolfpup64)
Eminent Member
Joined: 10 years ago

ah, somebody on the BuddyPress forum figured it out for me...now i just have to get it in the right place.


Page 2 / 2
Share: