Tagged: user profile tabs
I created a new tab in my users’ profile with 2 subtabs: (1) a list of posts (cpt) created by the user and (2) a form to create a post.
I would like to add a link to this form in a sidebar widget. This link has a structure like mydomain/members/user/my_cpt/new-message.
How can I set the “user” part dynamically so that user1 gets a link like mydomain/members/user1/my_cpt/new-message, user2 gets mydomain/members/user2/my_cpt/new-message etc.?
Hello Hugo,
Please check the following functions
// If you want to show link for displayed user bp_displayed_user_domain()other
// For logged user bp_loggedin_user_domain() //Specfic user bp_core_get_user_domain($user_id)Please let me know if it helps or not.
Regards
RaviOK, I checked https://codex.buddypress.org/developer/bp_component/.
But how can I create a link to a specific tab in the users’ profile? Do I need a custom function for that?Hi Hugo,
Do you want that for the logged users?
If yes, you can use the following example.http://example.come/members/me/component/action/....Example, if your members directory is “http://example.com/members/” then you can link to the cpt be
http://example.com/members/my_cpt/new-messageYou can use this syntax to link to any component screen of the logged user.
Regards
BrajeshHi Thomas,
Thank you for the question.Please open a new topic with details on what do you mean by create link for non logged in users and we will assist.
Regards
Brajesh
You must be logged in to reply to this topic.