BP Profile Shortcodes Extra Plugin
Insert Group, Follow, or User Profile details into a page or post, recreate many group and profile page options.
The ambition of this plugin is to provide all the shortcodes needed to create group and member profile dashboards using shortcodes. In addition is has wider features supporting general groups and member lists and the Activity “What’s New” form.
This is an extremely powerful plugin with many shortcode options allowing you to display a range of aspects from member profiles and groups.
This plugin now supports BP Follow, which although is out of date currently, I have a corrected version available for download. If the developers choose to update the plugin, their update will over-write the version that has been downloaded from BuddyPres User.
For the Block Editor support for shortcodes is either via blocks where appropriate or via the Classic block, from here you will see the BP Profile Shortcodes Extra dropdown menu to select the appropriate code. The classic editor does not render shortcodes as part of it’s preview capability currently, this may change as Gutenberg develops.
Profile Shortcodes
Displayname – As text or a link to the members profile page.
Username – As text or a link to the members profile page.
Avatar or Profile Image – As an image or a link to the members profile homepage.
Cover Image – As an image or a link to the members profile homepage.
Profile Header – A collection of cover image, avatar and username, with the username being a link to that members profile.
Profile Fields – You can display information from any of the profiles Xprofile fields.
Profile URL – shows the url, button or a link to user specific profile pages using the text of your choice.
Profile Edit Link – A link to the users edit profile page.
Profile Lists – Creates lists of users friends and groups and also lists of friend and group suggestions as well as general site member and group lists.
Private Message Link – displays a link to private message this selected user.
If no user_id is specified in the shortcode, the details of the member viewing that page will be displayed.
** Group Shortcodes**
Avatar Image – As an image or a link to the group homepage.
Cover Image – As an image or a link to the group homepage.
Profile Header – A collection of cover image, avatar and group name, with the group name being a link to that group homepage.
Group URL – shows the URL for the group or a link with the text specified by you.
Group Member list – shows either a collection of avatars or a list of members names, both are links to each members profile.
Group Description – displays the group description.
Group Field – displays various fields used by eac group.
** Activity Shortcodes
- What’s New – adds the activity What’s New inut form to a page.
BP Profile Shortcodes Extra provides an updated range of BuddyPress shortcodes, it was build upon the BuddyPress Profile shortcodes plugin and supports all of it’s features plus many more.
Most of the shortcodes accept many parameters to allow the output to be customized and tailored to meet your needs.
The following shortcodes are available:
[bpps_profile_displayname]
- Shows the display name.
- Can have a parameter of user_id= to get it for a specific user.
- Accepts user_id=”” for input.
- If no user_id is specified then the logged in user id will be used.
- If mention_name=”” is set the users mention name ( username ) is used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_displayname user_id=”1″ class=”member-name”]
- Displays the profile displayname for user id 1, the css class for that element will be set to “member-name”.
[bpps_profile_email]
- Same as above except for the email.
- The user_id parameter can be used optionally as well.
- Accepts user_id=”” for input.
- If no user_id is specified then the logged in user id will be used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- If mention_name=”” is set the users mention name ( username ) is used.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_email user_id=”bob” ]
[bpps_profile_username]
- Same as above except for the BuddyPress username
- The user_id parameter can be used optionally as well.
- Accepts user_id=”” for input.
- If no user_id is specified then the logged in user id will be used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- If mention_name=”” is set the users mention name ( username ) is used.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_private_message_link]
- Returns a link to private message the user.
- accepts user_id=”” as input.
[bpps_profile_url]
- Will get the url for where the user’s profile is.
- The user_id parameter can be used optionally as well.
- IF you use show = no then it will show as a link.
- You can use before = or after = parameters to define text to show before or after the link or before or after the text to add customization options.
- This will accept the parameter “profile_page” to have the url for any page for the profile specified. i.e. “settings” will go to the settings page.
- text=”name” will show the users displayname (“username” for WP Username ) as a link to their profile page. Otherwise any other text will be used as a as the text for the link.
- Accepts user_id=”” text, button=”button”, before, profile_page, after, rel, target, style, class, attribute_id, title, tabindex, and attributes for inputs.
- If no user_id is specified then the logged in user id will be used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- If mention_name=”” is set the users mention name ( username ) is used.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_url text=”Link to Profile”]
- Returns the link to the profile, the text specified is used as the anchor text.
[bpps_profile_url text=”Link to Profile” button=”button” ]
- Returns the link to the profile as a button, the text specified is used as the anchor text.
[bpps_profile_url text=”My Forums” profile_page=”forums” user_id=”bob”]
- Returns a link to Bob’s My forums page.
[bpps_profile_field field=”fieldname” tab=”section”]
** [bpps_profile_field tab=”Base” field=”Name”] uses the original method to display the profile field.
** [bpps_profile_field option=”Two” field=”Name”] uses the option two method to display the profile field.
[bpps_profile_field field=”Name” user_id=”2″]
- Displays displays the Name field from the Base profile group for user 2.
[bpps_profile_field field=”Details” user_id=”bill” tab=”More”]
- Displays the Details field from the More profile group for the user Bob.
[bpps_profile_avatar]
- Displays the members profile image.
- Can use the “dimension” parameter to change the dimensions of the avatar.
- You can use a height or width parameter to define the height or width of it as an alternative.
- The user_id parameter can be used optionally as well.
- Accepts user_id=”” id, rel, style, class, attribute_id, dimension, height, width and alt inputs.
- If no user_id is specified then the logged in user id will be used.
- If mention_name=”” is set the users mention name ( username ) is used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_avatar_url]
- Will get the profile/avatar image url.
- The user_id parameter can be used optionally as well.
- If you use show = no as a parameter it works similar to bp_profile_avatar.
- Accepts user_id=”” as input.
- If no user_id is specified then the logged in user id will be used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If mention_name=”” is set the users mention name ( username ) is used.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_avatar_link]
- Will get the avatar image as a link to the members profile.
- The user_id parameter can be used optionally as well.
- If you use show = no as a parameter it works similar to bp_profile_gravatar.
- Accepts user_id=”” id, profile_page, style, class, attribute_id, dimension, height, width and alt inputs.
- If no user_id is specified then the logged in user id will be used.
- If mention_name=”” is set the users mention name ( username ) is used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_cover_image]
- Displays the members profile cover image.
- You can use a height or width parameter to define the height or width.
- The user_id parameter can be used optionally as well.
- Accepts user_id=”” id, profile_page, rel, style, class, attribute_id, height, width and alt inputs.
- If no user_id is specified then the logged in user id will be used.
- If mention_name=”” is set the users mention name ( username ) is used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_cover_image_url]
- Will get the profile cover image url.
- The user_id parameter can be used optionally as well.
- If you use show = no as a parameter it works similar to bp_profile_gravatar.
- Accepts user_id=”” as input.
- If no user_id is specified then the logged in user id will be used.
- If mention_name=”” is set the users mention name ( username ) is used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_cover_image_link]
- Will get the profile cover image as a link to the members profile.
- The user_id parameter can be used optionally as well.
- If you use show = no as a parameter it works similar to bp_profile_gravatar.
- Accepts user_id=”” id, rel, style, class, attribute_id, height, width and alt inputs.
- If no user_id is specified then the logged in user id will be used.
- If mention_name=”” is set the users mention name ( username ) is used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found error.
[bpps_profile_edit_url]
- Will get the url for editing the user’s buddypress profile.
- The user_id parameter can be used optionally as well.
- You can use before = or after = parameters to define text to show before or after the link or before or after the text to add customizability.
- Accepts user_id=”” id, style, and alt for inputs.
- If no user_id is specified then the logged in user id will be used.
- If mention_name=”” is set the users mention name ( username ) is used.
- If displayed=”Yes” then the displayed user id will be used. This will only work on BP pages.
- If displayed=”Author” is used then the profile of the post author will be displayed. Only works on single posts and pages.
- Accepts error_msg=”” inorder to provide an alternative user not found message.
- Accepts display_error=”No” argument to suppress the user not found …
Installation
Option 1.
- From the Admin>>Plugins>>Add New page, search for BP Profile Shortcodes Extra.
- When you have located the plugin, click on “Install” and then “Activate”.
- Edit your post or page to add the shortcodes
With the zip file:
Option 2
- Upzip the plugin into it’s directory/file structure
- Upload BP Profile Shortcodes Extra’s structure to the /wp-content/plugins/ directory.
- Activate the plugin through the Admin>>Plugins menu.
- Edit your post or page to add the shortcodes
Option 3
- Go to Admin>>Plugins>>Add New>>Upload page.
- Select the zip file and choose upload.
- Activate the plugin.
- Edit your post or page to add the shortcodes
Screenshots
screenshot-1.png Profile Header shortcode output
screenshot-2.png Profile List shortcode Group list outputs
screenshot-3.png Profile List shortcode friends list outputs
screenshot-4.png Profile List shortcode suggested groups list
screenshot-5.png Profile List shortcode suggested groups avatar-list
Changelog
2.6.0
- Upgrade: Profile_lists now supports Follower and Following lists and grids.
- Improvements: Layour changes and HTML improvements.
2.5.5
*Fix: Group members shortcode now fixed.
*Update: translators comments added.
*Update: Updated escaping of attributes.
2.5.4
*Fix: replaced depricated functions.
2.5.3
*18/02/2024
- Fix: Added input escaping to all shortcode user inputs.
- Fix: Added is_numeric check to all numeric inputs
- Fix: Ensured all outputs are escaped
- Fix: Added additional validation for all requested group ID’s
- Fix: Added additional validation for all requested user ID’s
- Fix: All links now include nonce checks
2.5.2
2.5.1
2.4.1
2.4.0
2.3.5
2.3.4
2.3.3
2.3.2
2.3.1
2.3.0
2.2.0
- New: Added members list type to the profile lists shortcode.
2.1.0
- Fix: Corrected error with per_page options in profile lists shortcode.
- New: Introduced option=”avatar-grid-name” for profile lists shortcode.
2.0.0
1.9.3
1.9.2
1.9.1
1.9.0
1.8.0
1.7.6
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.6.2
1.6.1
1.6.0
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.0.0
Added Profile Lists shortcode with options for Group or Friends lists.
Added Group shortcodes – Avatar, URL, Cover-Image, Member List and Header.
Added Profile Cover Image Shortcodes.
Added Profile Header Shortcodes.
Fixed Class Constructor deprecation notice.
Fixed profile fields username is_string() condition error.
= Added error checking for instances of no valid username supplied.