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.?
Please check the following functions
// If you want to show link for displayed user bp_displayed_user_domain()
// 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.
OK, 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?
Do you want that for the logged users?
If yes, you can use the following example.
Example, if your members directory is “http://example.com/members/” then you can link to the cpt be
You can use this syntax to link to any component screen of the logged user.
You must be logged in to reply to this topic.