Hi,
I wasn’t sure if this was okay or not, if it’s not, please delete.
I have been messing around with a KLEO / BuddyPress install for a local community, I was working on the help section and I couldn’t find a simple / lightweight way to add dynamic profile links that were specific to the user.
I wrapped up a tiny bit of code (1.29 KB) into a plugin and I have attached here.
The plugin works as a shortcode for posts and pages, the format is as follows.
- [upl url=”/settings/notifications/” urltext=”Emails”]
This generates a link specific for the logged in / viewing user and direct them to the change email notifications page.
- [upl url=”” urltext=”Profile”]
This generates a link specific to the logged in / viewing user and will direct them to their default profile page (it should respect and changes you’ve made to the default profile landing page).
- When a user is not logged in they’re presented with “You’ll need to login so that we can generate this link for you.”. The login href is # and the class is kleo-show-login. This will open the login modal.
- url=”” defaults to profile when blank or not present
- urltext=”” must always be present and have content otherwise no link text will be generated.
Questions below, answers not guaranteed 😉
Kieran.
Attachments:
You must be
logged in to view attached files.