BP Profile Shortcodes Extra

Description

The ambition of this plugin is to provide all the shortcodes needed to create group and member profile dashboards using shortcodes.

This is an extremely powerful plugin with many shortcode options allowing you to display a range of aspects from member profiles and groups.

It includes an button to insert the shortcodes into the Classic WordPress editor and a range of Gutenberg Blocks where appropriate.

Gutenberg: Generally shortcodes that are typically used on their own are provided with their own Gutenberg blocks, for other shortcodes you’d like to use within text, you should use the classic Gutenberg 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.

  • 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 – show either a collection of avatars or a list of members names, both are links to each members profile.

** 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 taylored 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.

[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.

[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.

[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.

[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”]

  • Will get the field from the specified tab (profile group).
  • If the tab parameter is not used then it will get it from the primary / base tab profile group.
  • the user_id parameter can be used optionally as well.
  • The “field” would be the title and the “section” would be the tab / section.
  • The “shortcode” parameter, if set to 1 will assume the field holds a shortcode and will execute it.
  • The parameter “empty” will allow you to set what will show if the field is empty. Will return “Empty Text” by default.
  • Accepts user_id=””, field=”” empty=”” shortcode=”” and tab=”” for inputs.

[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.

[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.

[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.

[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.

[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.

[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.

[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.

[bpps_profile_edit_url text=”Edit Profile”]

  • Will get the link for editing the user’s buddypress profile.

[bpps_profile_header]

  • Returns a collection of the Cover Image, Profile Image and @Username with the Username as a link to the members profile homepage.
  • In the current release, it’s not possible to pass css parameters into the collection elements, so instead each element has been given css id’s and classes, so you can add your own custom css to style the output.
  • The collection is contained within a div with an id of “bppse-header”.
  • The cover image is held in a div with an id of “bppse-header-cover-image-cont” the image itself has an id of “bppse-header-cover-image”.
  • The profile image is held in a div with an id of “bppse-header-avatar”, the image iteslf has a class of “bppse-header-avatar”.
  • The Username has the “@” appended to it and is held in a div with an id of “bppse-profile-link”, the name is within h2 tags with a class of “bppse-header-nicename”,
  • Accepts user_id=”” input.

  • Example css:

    bppse-header {

    background-color: #f5f5f5;
    height: 320px;
    

    }
    .bppse-header-avatar {
    float: left;
    position: relative;
    top: -75px;
    left: 20px;
    }

    bppse-profile-link {

    position: relative;
    left: 30px;
    

    }

[bpps_profile_lists]

  • Returns a list of friends or groups for the selected user.
  • Supports three list formats; option=”list” – linked text list, option=”avatar-grid” – grid of group or friend avatars, option=”avatar-list” – List of links including Avatar and name.
  • Groups List can show users groups (default), groups user created (created=”true”) and groups user is administrator (admin=”true”).
  • Includes optional count of total friends or groups ( display_count=”true” / “false” ).
  • per_page=”” will set the maximum items for the list to display. Default is 20.
  • supports list_type=”friends_suggest” and list_type=”groups_suggest” to display suggested friends and groups.
  • For friends and groups suggestions, Group Join and Add Friend links are provided with css classes of bpse-join-group and bpse-add-friends respectively.
  • Also, if no suggestions for groups or friends are found, a link to the groups and members directory is provided.
  • group_desc=”false” will remove the group description from the Group list views, this is contained in a span element with a class of bpps-grp-desc.
  • latest_update=”false” will romove the users latest activity update and view link from the friends list items display.
  • promoted_groups=”2,5,9″ accepts the id’s of any groups you want to highlight in the group suggestions list, rand=”true” will ensure a randomized list of suggestions.
  • s_title=”default”, s_title adds a title of your choice in an h4 tag, entering default will include the users name in the title ( ie. “username’s friends” etc.).
  • Accepts user_id=””, alt=””, class=””, per_page=””, option=””, list_type=””, width=”” (default 100px), height=”” (default 100px), s_title=”no” admin=””, group_desc=”false”,
    latest_update=”” and created=”” as inputs.

[bpps_profile_lists user_id=”bob” list_type=”groups” created=”true”]

  • Will display up to 20 groups created by bob, a count of all groups created by bob with a link to bob’s My Groups page.

[bpps_group_url slug=””]

  • Will get the url for the group.
  • You can use group_id=”” to pass the group id or slug=”” to pass the group slug in order to identify the required group. Only use one of these settings, these are mandatory fields.
  • 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 customizability.
  • This will accept the parameter page=”” to return a link to any group tab, ie page=”forum” will return a link to the groups forum page. user page=”home” to return a lin to the group homepage.
  • Accepts group_id=””, slug, text, before, page, after, rel, target, style, class, attribute_id, title, tabindex, and attributes for inputs.

[bpps_group_url text=”Link to Group” slug=”test-group” ]

  • Returns the link to the group homepage for the group with a slug of test-group, the text specified is used as the anchor text.

[bpps_group_url text=”Group Forum” page=”forum” group_id=”2″ ]

  • Returns a link to the forum page of group with an id of 2.

[bpps_group_avatar]

  • Displays the groups avatar 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.
  • Use of either the group_id or slug parameters is mandatory.
  • Accepts group_id=””, slug, id, rel, style, class, attribute_id, dimension, height, width and alt inputs.

[bpps_group_avatar_url]

  • Will get the avatar image url.
  • Use of either the group_id or slug parameters is mandatory.
  • Accepts group_id and slug as inputs.

[bpps_group_avatar_link]

  • Will get the avatar image as a link to the groups homepage.
  • Use of either the group_id or slug parameters is mandatory.
  • Accepts group_id=””, slug id, style, class, attribute_id, dimension, height, width and alt inputs.

[bpps_group_cover_image]

  • Displays the groups cover image.
  • You can use a height or width parameter to define the height or width of the image.
  • Use of either the group_id or slug parameters is mandatory.
  • Accepts group_id=””, slug, id, rel, style, class, attribute_id, height, width and alt inputs.

[bpps_group_cover_image_url]

  • Will get the cover image url.
  • Use of either the group_id or slug parameters is mandatory.
  • If you use show = no as a parameter it works similar to bp_profile_gravatar.
  • Accepts group_id=”” and slug as inputs.

[bpps_group_cover_image_link]

  • Will get the group cover image as a link to the group homepage.
  • Use of either the group_id or slug parameters is mandatory.
  • Accepts user_id=”” id, rel, style, class, attribute_id, height, width and alt inputs.

[bpps_group_header]

  • Returns a collection of the Cover Image, Avatar and Group Name with a link to the group homepage.
  • Use of either the group_id or slug parameters is mandatory.
  • In the current release, it’s not possible to pass css parameters into the collection elements, so instead each element has been given css id’s and classes, so you can add your own custom css to style the output.
  • The collection is contained within a div with an id of “bppse-grp-header”.
  • The cover image is held in a div with an id of “bppse-grp-header-cover-image-cont” the image itself has an id of “bppse-grp-header-cover-image”.
  • The profile image is held in a div with an id of “bppse-grp-header-avatar”, the image itself has a class of “bppse-grp-header-avatar”.
  • The Group Name is held in a div with an id of “bppse-grp-group-link”, the name is within h2 tags with a class of “bppse-grp-group-header-nicename”,
  • Accepts group_id=”” and slug input.

  • Example css:

    bppse-grp-header {

    display: block;
    height: 350px;
    background-color: #f5f5f5;
    

    }

    bppse-grp-header-cover-image {

    width: 100%
    

    }
    .bppse-grp-header-avatar {
    float: left;
    position: relative;
    top: -75px;
    left: 20px;
    }

    bppse-grp-group-link {

    position: relative;
    left: 30px;
    

    }

[bpps_group_member_list]

  • Displays a list of group members.
  • Use of either the group_id or slug parameters is mandatory.
  • Can display simple list (option=”list”), a grid of group avatars ( option=”avatar-grid” ) or a linked list with avatars ( option=”avatar-list” ).
  • per_page=”20″ sets the number of members to display (default 20).
  • includes options count of all group members with a link to the group members page ( display_count=”yes” / “no” ).
  • s_title=”default”, s_title adds a title of your choice in an h4 tag, entering default will include the groups name in the title ( ie. “Members of Groupname” etc.).
  • Accepts Group_id=””, slug, alt, before, after, height, width, class, s_title, per_page and display_count as inputs.

[bpps_whats_new]

  • Displays the “What’s New” activity input form in the page.
  • Currently no additional attributes are supported.
  • Currently BP-Nouveau is not supported.

forked as BP Profile Shortcodes Extra

  • Initial version – BuddyPress Profile 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

Installation

Option 1.

  1. From the Admin>>Plugins>>Add New page, search for BP Profile Shortcodes Extra.
  2. When you have located the plugin, click on “Install” and then “Activate”.
  3. Edit your post or page to add the shortcodes

With the zip file:

Option 2

  1. Upzip the plugin into it’s directory/file structure
  2. Upload BP Profile Shortcodes Extra’s structure to the /wp-content/plugins/ directory.
  3. Activate the plugin through the Admin>>Plugins menu.
  4. Edit your post or page to add the shortcodes

Option 3

  1. Go to Admin>>Plugins>>Add New>>Upload page.
  2. Select the zip file and choose upload.
  3. Activate the plugin.
  4. Edit your post or page to add the shortcodes

FAQ

Installation Instructions

Option 1.

  1. From the Admin>>Plugins>>Add New page, search for BP Profile Shortcodes Extra.
  2. When you have located the plugin, click on “Install” and then “Activate”.
  3. Edit your post or page to add the shortcodes

With the zip file:

Option 2

  1. Upzip the plugin into it’s directory/file structure
  2. Upload BP Profile Shortcodes Extra’s structure to the /wp-content/plugins/ directory.
  3. Activate the plugin through the Admin>>Plugins menu.
  4. Edit your post or page to add the shortcodes

Option 3

  1. Go to Admin>>Plugins>>Add New>>Upload page.
  2. Select the zip file and choose upload.
  3. Activate the plugin.
  4. Edit your post or page to add the shortcodes

Contributors & Developers

“BP Profile Shortcodes Extra” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.4.2

  • 07/06/2018

  • Fix: Corrected link for profile edit url.

1.4.1

  • 03/06/2018

  • Fix: Added attribute support for button.

1.4.0

  • 02/06/2018

  • New: Added button=”button” feature to [bpps_profile_url] shortcode to display a button.

1.3.1

  • 24/05/2018

  • Fix: corrected js load error when tinyMCE not loaded on admin post.php page.

1.3.0

  • 14/05/2018

  • New: Added support for Gutenberg with dedicated blocks for appropriate shortcodes.

1.2.1

  • 08/05/2018

  • Fix: Prevent js from being loaded on pages without tinyMCE loaded.

1.2.0

  • 08/05/2018

  • New: Added button to insert the shortcodes into the WP editor.

1.1.2

  • 04/05/2018

  • Added option in [bpps_profie_url text=”username”] to use the username of the user as the text for the link to the required url.

  • Added profile_page support for profile avatar link and profile cover image link shortcodes.

1.1.1

  • 03/05/2018

  • Added option in [bpps_profie_url text=”name”] to use the displayname of the user as the text for the link to the required url

1.0.5

  • 30/04/2018

  • updated readme text for bpps_prifile_field shortcode.

1.0.4

  • 15/04/2018

  • Added What’s New Activity input form.

1.0.3

  • 10/04/2018

  • Fix – adjusted layout of List option in Profile Lists shortcode.

  • Fix – adjusted layout of the group descriptions and friend update text.
  • Fix – removed comments from friend update text.

1.0.2

  • 10/04/2018

  • Added latest activity update to the Profile List Friends shortcode.

  • Added Group descriptions to Profile List shortcode.
  • Fix – Corrected non object errors.
  • Fix – corrected index not found error.

1.0.1

  • 10/04/2018

Changed a number of yes/no inputs to true/false for the Profile Lists shortcode.

Added Group suggestions to the Profile List shortcode

Added Friend Suggestions to the Profile List shortcode.

Added s_title=”default” option to [bpps_profile_lists] and [bpps_group_members] shortcodes.

1.0.0

  • 08/04/2018

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.