Using BuddyPress for Social Networks

Plugin – BP Profile Shortcodes Extra

Plugin – BP Profile Shortcodes Extra

https://wordpress.org/plugins/bp-profile-shortcodes-extra

BP Profile Shortcodes is a fork of BuddyPress Profile Shortcodes, there were a number of bugs and deprecation notices affecting that plugin and it had not kept up to date with new BP features such as cover-images. I’ve felt for a long time that this plugin missed a number of key features, so I decided to fork it. I did offer my code to the plugin developers but I’ve not had a response and after a month of waiting I decided to released my forcked version as a new plugin in the Repo.

BP Profile Shortcodes Extra maintains the features introduced in the original plugin, it provides shortcodes to display the username, display name, profile url, avatar photo etc. but in addition it provides the ability to display the users cover image, the profile header and lists of the users friends and group memberships.

I also decided to add a similar set of features for groups, so now you can display links to group pages, the group avatar, cover image and header and also list the group members.

A number of users were having problems with the Profile Field shortcode, with the error “Invalid Tab selected”, I could not recreate this issue but I decided to implement an additional method of selecting the field. so this shortcode now has two options. Full details in the readme but the following is now an option to display for example the name: [bpps_profile_field option=”Two” field=”Name” ]

The complete feature set is as follows:

Member Profile Shortcodes

* Display Name – 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, url or link to the members profile homepage.

* Cover Image – As an image, url or with 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 Field – You can display information from any of the profiles Xprofile fields.

* Profile Edit link – link the the users edit profile page

* Profile Lists – provide friends and groups lists – Three list styles – List, avatar grid and avatar list. Group lists support group memberships, groups created and groups administered by the user.

* If no user_id is specified in the shortcode, the details of the member viewing that page will be displayed.

Group Shortcodes

* Group Links – provide links to any group page (home, activity, forum etc.

* Group Avatar Image – as an image or lnk to the group homepage

* Group Cover-Image – as an image or a link to the group homepage

* Group Header – including cover-image, avatar and group name with link to group homepage.

* Group Member List – three different list styles – text list, avatar grid and avatar list

* Group Description – displays the group descriptiion for the selected or displayed group.

* Group ID must be specified as either the Group Id or the Group slug.

BP Profile Shortcodes Extra fills a gap where site members need to display profile or group information in posts, more advanced users could use it as a basis to create custom dashboard pages for users, a single page can be created and added to the users navbar in order to fully integrate the shortcode functionality with existing BuddyPress pages.

I’m open to further suggestions as to how to further develop this plugin. I’ve already got a god list of possible developments but I’d really appreciate some user feedback. I’ve added a lot of custom CSS attributes to help you style these page elements and it would be really good to see how this works in practice.

 

    • James on April 17, 2018 at 6:14 pm

    Reply

    This plugin is amazing.
    I am new to webpage design and I am having an issue with the style attribute in the shortcode. I am wanting to add a 5px solid border with a radius of 25px around a users avatar by adding the style option to the shortcode [bpps_profile_avatar_url]. Is this possible via the shortcode style option?

      • Venutius on April 17, 2018 at 6:37 pm
      • Author

      Reply

      Hi James,

      Yes you can simply add style=”border-radius: 25px;” etc. to the shortcode and it should work.

      • Venutius on April 27, 2018 at 1:12 pm
      • Author

      Reply

      That’s interesting, I’ll do some testing later and make sure this is working correctly, I’ll get back to you.

        • Jack on November 30, 2018 at 2:04 pm

        Reply

        Hello Venutius,
        sorry for probably my stupid question, but when I’m using the [bpps_profile_avatar] shortcode, I’m not able to make the avatar with rounded style or make it bigger. Could You suggest me on how to compile it?
        Thank You in advance

          • Venutius on November 30, 2018 at 2:17 pm
          • Author

          Reply

          Hi there Jack,

          If I were looking to do what you are looking for I’d’ use something like [bpps_profile_avatar dimension=”150″ class=”shortcode-avatar”]

          Dimension is one setting for both height and width
          Setting the class would allow you to turn the image round, if you used item-avatar as the class, it would inherit the standard settings for the BP Avatar, so if you’ve set that to round it should reflect that.

          Hope that helps

    • Matt on April 27, 2018 at 7:41 am

    Reply

    Hi,
    Awesome and very useful plugin, great job!

    I’m having a problem with getting [bpps_profile_field field=”fieldname” tab=”section”] to work.
    I keep getting “The tab name is invalid” error. Would you be able to provide some detailed instructions or examples please?
    I really appreciate your help

      • Venutius on April 27, 2018 at 8:07 am
      • Author

      Reply

      Hi Matt, thanks for giving the plugin a try. the tab=”” setting would need to reflect the field group that you are trying to pull the data from, the default tab used by BP is “Base”, so if you wanted to pull the Name field from there you would enter [bpps_profile_field field=”Name” tab=”Base” ].

      Hope that helps.

        • Matt on April 27, 2018 at 12:26 pm

        Reply

        Thank you for your quick reply!

        That’s exactly what I’ve done before reaching out to you ( I think) and it didn’t work.
        Just so we are on the same page: I am trying to display fields from Users/Profile Fields.
        I’ve created a number of field groups in there. Each group has a number of fields also.
        For example I have a field group called “Availability” and field called “Days”.
        I’ve tried the following shortcode: [bpps_profile_field field=”Days” tab=”Availability” ]. It resulted in “The tab name is invalid” being shown.

        Please advise if I’m doing something wrong, cheers.

          • Venutius on April 28, 2018 at 10:19 am
          • Author

          Reply

          Hi Matt,

          I tested this and the shortcode works for me, I tested it with both the Base tab and another tab I created called More Info, I was able to select and display info from fields in both tabs. I can’t see what you are doing wrong but somewhere you must be – maybe check the tab name that you are using? Maybe as a first tst you should see if you can get the Name from Base?

            • Matt on April 30, 2018 at 1:58 am

            Thanks for the help.

            The only shortcode that works for me is : [bpps_profile_displayname]
            I can’t get Name from Base. My Primary Field Group is called “Personal”, I’ve tried that and it doesn’t work either.
            Could you maybe email me directly and I’d send you some screenshots if that helps?

            Thanks so much

            • Venutius on April 30, 2018 at 8:12 am
            • Author

            Hi Matt, As requested I’ll email you directly.

            • Daniel on December 11, 2018 at 6:26 pm

            Hello, I’m having the exact same problem and am wondering how this got resolved. I’d love to know what was in that email because this is a carbon copy of the issue I’m having. I’m just trying to display custom field named City in the tab/section/group default named Base. I have the following code and it doesn’t work:

            [bp_profile_field field=”City” tab=” Base”]

            I’ve also tried [bpps_profile_field tab=”Base” field=”City”] and [bpps_profile_field option=”Two” field=”City”] but all don’t work as I get field or tab errors. However, like Matt, the code [bpps_profile_username] will display correct field in Contact Form 7 form I’m building. Please advise and thank you in advance!!!

            • Venutius on December 11, 2018 at 7:10 pm
            • Author

            Hi Daniel,
            Most of the recent issues have been fixed using the option=”Two” setting as you have done correctly so it should have worked for you too. How many tabs do you have?

    • V Kecman on June 29, 2018 at 11:25 am

    Reply

    After adding some shortcodes to the page, we get these errors (see below).
    What went wrong? I can provide complete error info.

    Warning: Illegal string offset ‘option’ in …

    Warning: Illegal string offset ‘option’ in…

    Fatal error: Uncaught Error: Call to undefined function bp_get_messages_slug() in …

      • Venutius on June 29, 2018 at 11:44 am
      • Author

      Reply

      Sorry to hear about the errors, can you let me know which shortcodes you were using?

      • Venutius on June 29, 2018 at 11:49 am
      • Author

      Reply

      This error “Fatal error: Uncaught Error: Call to undefined function bp_get_messages_slug() in …” points to some other problem on your system, I’ve checked and this BuddyPress function should be there in the current version of BuddyPress, so if you are getting this error them either BP is not loading correctly or you do not have messaging enabled.

      • Venutius on June 29, 2018 at 11:51 am
      • Author

      Reply

      Also, my plugin does not use the offset ‘option’ so I’m unclear how it could be causing this error.

    • Nathan on August 20, 2018 at 11:27 pm

    Reply

    Hey Venutius,

    I keep getting “The Tab Name Is Invalid” or “The Field Name Is Invalid” even when I follow your trouble shooting steps and use base and name.

      • Venutius on August 21, 2018 at 4:12 pm
      • Author

      Reply

      Hi Nathan,

      Sorry to hear you are having issues, I can’t replicate your issue, in that I can request the Name field from the Base tab and it displays the users name as expected. Not sure what to suggest.

    • Blake Bailey on September 26, 2018 at 4:44 am

    Reply

    Hello!

    I love the plugin, and tried to comment something similar before so my apologies if it did go through and this is a duplicate.

    I’m trying to use an xprofile field value as the ‘user_id=’ in a few of the shortcodes, but am having no luck. The reason being that I am matching users of my site up and would like to display a user’s “match” on a particular page, which ofcourse will be different based on whomever the user is looking at the page.

    So I’ve set a matching user’s ID as each user’s xprofile field value for a field called ‘Match 1 ID’ and would like a few different shortcodes to run this: user_ID=’Match 1 ID’

    I’ve tried using the profile fields shortcode in that spot but it doesn’t work. Any ideas?

      • Venutius on October 6, 2018 at 11:40 am
      • Author

      Reply

      Hi there, the way the plugin works is if there is no entry for the user_id then it will use the logged in (user_id of the person viewing the page) user id for the look up. if the user_id is specified then it must be a valid numeric value for that user. I think you’d need to customise the plugin in order to get the functionality you are looking for.

    • Max on October 15, 2018 at 8:07 pm

    Reply

    Hi, I too have the problem with “The tab name is invalid” when trying to get xprofile fields.

      • Venutius on October 15, 2018 at 8:19 pm
      • Author

      Reply

      Hi Max, we are discussing it here and think the solution is to switch to Text mode in the editor when writing the shortcode.

    • Kara on November 6, 2018 at 12:11 am

    Reply

    Hi I tried using this to expose the Name field [bpps_profile_field field=”Name” tab=”Base” ] and I’m still getting the Tab name invalid even with making sure I’m in Text mode.

    Is there anyway I can send you a screenshot of what I have?

      • Venutius on November 6, 2018 at 11:39 am
      • Author

      Reply

      Hi Kara, Sorry to hear you are having issues. My problem is that it works fine on my test server so it’s been a difficult one to track down. Maybe I could get access to your system to see what’s going on? you can email me at venutius at buddyuser.com.

      • Venutius on November 10, 2018 at 9:29 am
      • Author

      Reply

      Hi Kara, I’ve updated the plugin to include two methods of displaying the users profile fields, I’ll update this page with details.

    • Titus on December 4, 2018 at 9:42 pm

    Reply

    Hi Venutius,

    Can I please email you. I like to find out cost to extend the capability of this plugin for my particular project.

    [bpps_profile_field option=”Two” field=”Name” ]

    Thanks
    Titus

      • Venutius on December 5, 2018 at 8:20 am
      • Author

      Reply

      I’ve sent you and email

    • Diego Miguel on December 17, 2018 at 3:02 pm

    Reply

    Hi, I downloaded the BP Profile Short Code Extra and BP Post Status plugins in order to solve a problem I have on my site:
    I need all users could see who belongs to each group (including private groups they do not belong to).
    I have written the short code of “member list” inserting it into the group page through the widget as follows:
    [bpps_group_member_list option=”list” per_page=”20″ display_count=”yes” s_title=”default” Group_id=”14”]
    But it doesn´t work, could you tell me how I should do it? Or any other solution to achieve it?
    That would help me a lot.
    The problem I have is that I need users could see the list of members even if they do not belong to a private group.
    Thank you very much in advance, Greetings!

      • Venutius on December 17, 2018 at 5:18 pm
      • Author

      Reply

      Hi there, you spotted a typo in the readme file, the shortcode to use is [bpps_group_members], also I’ve updated it so that if you don’t specify a group it will pick up the group if it’s being shown in a group page, so you should be able to display it in a sidebar widget and it will display the members. Remember to update to the latest version for this.

    • Adam on January 5, 2019 at 2:04 am

    Reply

    Hello Venutius,

    Is there a way to hide the “User not found’ message from the profile photo and username shortcodes when a user is not logged in?

      • Venutius on January 5, 2019 at 9:44 am
      • Author

      Reply

      Hi Adam,

      I’ve updated the plugin with a new option – display_error=”No” which will suppress the error message, give it a try.

    • Nimblesage on January 17, 2019 at 3:16 pm

    Reply

    This plugin is awesome!

    I am using the code below within a custom content loop to display the name of the poster. Instead, it displays the name of the logged in user viewing the page.

    [bpps_profile_displayname]

    How can I modify it to achieve what I’m after?

    Thanks!

      • Venutius on January 18, 2019 at 11:46 am
      • Author

      Reply

      I’ve added an author feature ( displayed=”Author” ) to the profile shortcodes, please give it a try.

    • Marte on January 18, 2019 at 11:10 am

    Reply

    Line 1159 in file bppsc-shortcodes-extra.php starts with ‘If’ in stead of ‘if’.
    Because PHP is case-sensitive I suppose this is not correct.

      • Venutius on January 18, 2019 at 11:45 am
      • Author

      Reply

      Hi Marte,

      Thanks for the bug report, I’ve fixed that in the new version.

    • Fabio on March 11, 2019 at 3:26 am

    Reply

    Hello, your plugin “BP Profile Shortcodes Extra” is very powerful, I am implementing it on my website, but I have not been able to know how I can show the avatar of all the members that are not in groups. Could you please indicate how it is done? Thank you.

      • Venutius on March 11, 2019 at 6:38 am
      • Author

      Reply

      Hi Fabio,

      I’m afraid that’s not a feature of this plugin, sorry.

    • Brahim on October 21, 2020 at 6:40 pm

    Reply

    Hello,

    Is it possible to create a shortcode for displaying the likes given by the logged-in user? I wasn’t able to find this in the documentation.

    Kind regards,

    B

      • Venutius on January 19, 2021 at 2:58 pm
      • Author

      Reply

      Do you mean favourites?

    • Victoria on February 19, 2021 at 11:00 am

    Reply

    Hi, Venutius, i love your plugin “BP Profile Shortcodes Extra” is really awesome, I am using it in my website, but i try using the following short codes “[bpps_profile_displayed=”Author”],[bpps_profile_url text=”Link to Profile”]” to link to Author’s profile from post, but none of it works. I intend to create a link that user can click to check authors profile.

    i also use this short code [bpps_displayed=”Author”] to display author’s name and username to other users, but it was not working. Could you please tell me how it is done?

    Thank you.

      • Venutius on February 19, 2021 at 11:35 am
      • Author

      Reply

      Hi Victoria, You are not using the shortcodes correctly, for the displayed user name you’d user [bpps_profile_displayname] on a post you can use [bpps_profile_displayname displayed=”Author” ] to automatically pick up the info from the authors BP details. Hope that helps.

      • Venutius on February 19, 2021 at 11:41 am
      • Author

      Reply

      So in your case you’d use [bpps_profile_url text=”Link to Profile” displayed=”Author”]

    • Rob on March 5, 2021 at 10:20 am

    Reply

    Plugin looks promising and I wish I could use it. But no matter what, when I try to display field a I get the ” The tab name is invalid ” message 🙁

    Adding this to the WordPress Shortcode Gutenberg block:

    [bpps_profile_field field=”Screen Name” option=”Two”]

    Anyway, seems like a persistent problem and just wanted to report that it’s still happening, doesn’t look like it’s going away.

      • Venutius on March 5, 2021 at 10:47 am
      • Author

      Reply

      Hi Rob, Sorry you are having problems, have you tried setting the tab name?

      • Venutius on March 5, 2021 at 11:53 am
      • Author

      Reply

      I’ve just test this and it works – [bpps_profile_field field=”Name” user_id=”2″] maybe you need to add the user_id?

    • Lars on May 19, 2021 at 12:22 pm

    Reply

    Hello Venutius..

    Extremely Grateful for this Super-Script.. & your kind patience demonstrated here!

    I have the bpps_profile_header setup, with decent css tweaks, on site-wide sidebar.

    Question: is there any way to provide dynamic call for profiles featured there.. ?_?
    As with, for example, list_type=”group-lists” groups_sort=”ACTIVE” or list_type=”members” members_sort=”NEWEST”..
    Again.. “Any” option would be fine.. perhaps “Random” would be best.. for fun.. 🙂

    Cheers from Tokyo.. =^__^=

    • simon on June 28, 2021 at 2:41 am

    Reply

    Hi do you know how to format the date from the create new field? When use it by shortcode I received this: 2030-01-01 00:00:00 instead of January 1, 2030, from the date format in the profile settings.

    I tried this [bpps_profile_field field=”Date” Option=”Two” date-format=”F j, Y”] but it does not work form me

    Thanks in advance!

    • David on March 21, 2023 at 11:07 am

    Reply

    Hey Venutius, first of all thank you for this awesome plugin.
    My question is if there is a way to change the displayed label on the shortcode:
    Private Message Link – [bpps_profile_private_message_link]
    When used the following hyperlink gets displayed: “Private Message {user_name}”
    Is there a way to customize the displayed text or translate it. It would be perfect for me to say maybe “Click here!” to act more as a button. I hope you understand what I mean.
    Thank you and best wishes,
    David

      • Venutius on May 1, 2023 at 11:40 pm
      • Author

      Reply

      Hi David,

      I’m just getting back into programming and will take a look at this tomorrow. if memory serves you should be able to change this

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.