I’ve just released version 1.5.5 of BuddyPress in the wordpress.org repository. BP 1.5.5 is a security and maintenance release. Read more about it at the buddypress.org blog http://buddypress.org/2012/03/buddypress-1-5-5/ or on the Codex http://codex.buddypress.org/releases/version-1-5-5/
Updates from Boone B. Gorges RSS Toggle Comment Threads | Keyboard Shortcuts
-
Boone B. Gorges
-
Boone B. Gorges
Several weeks ago, a series of changesets addressed what is perhaps the most popular request in the history of BuddyPress: profile privacy. (See #3695.) We’re calling it “visibility”, and you can check it out now in BP trunk. Here’s what developers need to know:
- Users can edit their profile field visibility on a field-by-field basis.
- Options available by default under “Who can see this field?” are Anyone, Logged In Users, and My Friends.
- Site administrators can select a default visibility level for each field. Admins can also force a field to maintain the default visibility – for instance, an admin may decide that a field called “Phone Number” should always be limited to Friends. (See the new
bp_xprofile_map_meta_caps(), and thebp_xprofile_change_field_visibilitycap.) - Developers can customize the available options using two new filters:
bp_xprofile_get_privacy_levels– Register or deregister new privacy levels with this filter. The data being filtered here is an array that looks like this:array( 'public' => array( 'id' => 'public' // Canonical, non-translatable name 'label' => __( 'Anyone', 'buddypress' ) // Label visible to users ), // etc )Add or remove items as you see fit.
bp_xprofile_get_hidden_fields_for_user– This is an array of xprofile field ids that should *not* be visible for the current viewer of the current displayed profile.
In the upcoming weeks, I’ll write a short example plugin to demonstrate how to remove existing levels and add custom levels.
- While the visibility filtering does not happen at the template level itself, the markup that allows users to modify profile visibility does require theme-level changes. The two key files are: /members/single/profile/edit.php (see the block beginning
if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) )) and /registration/register.php. In each case, you should be able to simply copy and paste the relevant blocks from bp-default; if you need to support older versions of BP, you may want to wrap it in aif ( function_exists( 'bp_xprofile_get_privacy_levels' ) )check.Note that if your theme does not provide the proper markup for users to customize their profile field visibility, fields will default to the admin-provided visibility level, which itself defaults to Public. Thus, the feature degrades gracefully in the absence of theme support.
Questions or comments? Leave them below, or in a relevant Trac ticket.
-
slaFFik
Yay! That’s what the whole community wants!
Thanks, Boone, for such news
And what about activity items, profile sub-pages?
-
Boone B. Gorges
Just xprofile fields for now. Activity items are immensely more complicated and resource intensive. Profile subtabs are handled by the components that register them, so would have to be taken care of in a distributed fashion. Maybe in the future
-
-
slaFFik
And can we expect this to be in 1.6?
-
Boone B. Gorges
Yes, this will be in 1.6.
-
slaFFik
You made my working night
-
-
-
croixhaug
A client just asked about this as a custom feature, awesome that it will be part of core!
-
hoho
great !!
-
modemlooper
My profile privacy plugin handles sub tab privacy
-
Martin
Awesome news! Now BP is on the best way to get the favorite tool to create a social network. I cant wait until the acvtivity stream get its own privacy settings too
-
Jimmy
So will this change create the ability to have different registration forms/fields depending on what option the users choose when registering?
-
Boone Gorges
No. These changes allow the user to dictate who gets to see the data he/she enters into profile fields. It does not introduce any logic for profile field dependence.
-
Thomas
I have seen this request in the forums is there any discussion in including this in the core in the future? I’m sorry if this is already been brought or is in the tickets newbie with wp and bp..
-
Boone Gorges
There is a ticket for similar functionality at https://buddypress.trac.wordpress.org/ticket/3962, which has been closed as ‘wontfix’ for now, in the hopes that a plugin developer will build it.
-
-
-
Boone Gorges
As promised, here is a sample plugin to show how these visibility levels can be extended: https://github.com/boonebgorges/bbg-custom-bp-field-visibility
That plugin does two things: Removes the ‘friends’ level, and adds a new ‘Admins Only’ level. It should give you the framework needed to add whatever levels your heart desires.
-
Hamed
Can users create their own privacy groups?
-
Boone B. Gorges
BP 1.5.3 is available, with some fixes for better WP 3.3.x compatibility. Read http://buddypress.org/2012/01/buddypress-1-5-3/ for more details.
-
Boone B. Gorges
BP 1.5.1 was just released. Check out the blog post, the changelog, and the Trac milestone.
Thanks to all contributors for your hard work!
-
Boone B. Gorges
A new version of the BuddyPress Skeleton Component, complete with rich documentation on how to use the new BP_Component class, is now available. Read more about it.
-
Boone B. Gorges
If you’ve used the BP Template Pack to make your WP themes BP-compatible, you’ll be happy to know that BP Template Pack 1.2 is fully compatible with BP 1.5. Check out the announcement post here.
-
Boone B. Gorges
There was a quirk in the way that BuddyPress 1.2.x’s Blogs component recorded posts and comments in the activity stream. With you published a new post, it only got published in the activity stream if
$post->post_type == 'post'. In other words, Pages and all custom post types were ignored. On the other hand, no such post_type check took place in the case of comments, with the result that comments on pages and other post types did show up in the stream.This odd inconsistency was fixed in the BuddyPress trunk with changeset 4959; BuddyPress now checks to make sure that the item being commenting on is a WordPress ‘post’ before adding the comment to the activity stream. However, anointed chimed in to let us know that some BuddyPress admins were taking advantage of the quirk. The result of this discussion is r4971, in which the post type checks are enhanced by turning them into checks against a filterable whitelist.
Plugin authors should be aware of this changed default behavior. If your plugin creates custom post types, and if you want comments on those custom post types to be recorded in the BP activity stream by
bp_blogs_record_comment()(if you are using your own function for this purpose, you don’t need to worry about the change), you will have to update your plugin to do something like this:
function bbg_record_my_custom_post_type_comments( $post_types ) { $post_types[] = 'dolphin'; // Add your custom post type name to the array. If you have a post type called 'dolphin' then you have a weird plugin return $post_types; } add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_my_custom_post_type_comments' );-
Dianakc
Newbie question: BP or WordPress plugins should add this filter?
-
Boone B. Gorges
Any plugin that wants to record comments on custom post types in the BP activity stream using bp_blogs_record_comment(). If any of the following are true about your plugin, then this post does *not* apply to you:
- your plugin has nothing to do with BuddyPress
- your plugin does not use a custom post type to store data
- your plugin uses a custom post type, but does not use comments on those CPTs
- you have manually unhooked bp_blogs_record_comment(), and are recording CPT comments with your own custom function
(In short, it really only applies to a small number of existing plugins.)
-
stevenkword
@Boone — Great solution. This helped me out today. Thanks!
-
-
Simon
Question for you Boone, so let’s say you have a WP / BP site where your primary “members” can create posts. Does the above functionality (function bbg_record_my_custom_post_type_comments) imply that both post creation and commenting on posts can be integrated into the activity stream?
caus that would be really cool.
-
Simon
Further to that last question….
Are there any caveats within the new 1.5 framework to tie custom post types to groups?
i.e. create a new post in a group?
-
-
landwire
Keep me informed on this.
-
Johan
Hm, I can’t get this working. I’ve tried adding the bit of code above (after replacing “dolphin” with my custom post type) to the plugin files, functions.php and bp-custom.php but no luck.
Comments made on my custom post type pages does not appear in the activity stream. Any ideas?
Thanks
-
Johan
Bump. Anyone have an idea of why my custom post type comments won’t show up in the activity stream? Any suggestions on how to troubleshoot?
Thanks!
-
Anthony
Same here. Would love to get this working
-
-
Mika "Ipstenu" Epstein
Johan – This is the wrong place to post that. You should post in the support forum.
-
-
Boone B. Gorges
In a few of the previous posts in the 1.5 plugin update series, I’ve talked about maintaining backward compatibility with earlier versions of BP while upgrading your plugins for BP 1.5. In those posts, I suggest the
function_exists()method, which will always work nicely.However, there’s another method you might want to consider: update your plugin as if you weren’t going to support earlier versions of BP, and then conditionally include an abstraction file that defines the necessary functions. Here’s what I mean.
When I was upgrading BuddyPress Group Email Subscription for BP 1.5, I wanted to make use of a few BP 1.5-only functions: namely, bp_is_groups_component() and bp_is_group(). So I did. Then, I created a new file called 1.5-abstraction.php, which looks like this. You’ll notice that I haven’t copied the functions directly over from the 1.5 source. The main reason for this (especially in the case of bp_is_groups_component()) is that the original function references
bp_is_current_component(), which in turn has a bunch of complicated logic that is not necessary in my case. So, in my case, it made sense to take a minute to write less general functions from scratch. However, I could just as easily have copied these two functions directly into my abstraction file.Then, I loaded the 1.5-abstraction.php file conditionally, like so:
if ( defined( 'BP_VERSION' ) && version_compare( BP_VERSION, '1.5-beta-1', '<' ) ) { require_once( dirname( __FILE__ ) . '/1.5-abstraction.php' ); }In this way, I only load the file when necessary.
The nice thing about this method is that my main codebase remains clean and easy to read. When I decide to drop backward compatibility for early versions of BP, this file can simply be removed from the package.
Another great thing about these abstraction files is that we can share them. Feel free to copy the small one from BP Group Email Subscritpion into your own plugin and build upon it – and share your own version with other developers.
-
Ray
I just use `version_compare( BP_VERSION, ’1.3′ ) < 0`, which does the same thing, but I don't have to type out the long beta string
-
Boone B. Gorges
Smart
-
modemlooper
but Apple has made it trendy to drop support and make things obsolete older than 6 months.
-
Boone B. Gorges
I guess that makes us a bunch of non-trendy dorks. But I already knew that.
-
-
Stas Sușcov
Hey,
I was thinking maybe bpdevel team should release those functions into a plugin?-
Boone B. Gorges
It’s a big job, and will create a really big file with functions that will be unnecessary for most plugins. That said, if someone wants to step up and do it, they are more than welcome
-
-

Master of Awesomeness 10:03 pm on April 9, 2012 Permalink |
Is there a way you could make BuddyPress available for WordPress.com??? I really enjoy BuddyPress for a site I write for with WordPress, but I also make websites with WordPress.com and BuddyPress would really help me.
Chris Clayton 6:38 am on April 10, 2012 Permalink |
@awesomebentv i don’t believe their is anything that the BuddyPress Core Devs can do as it’s ultimately up to Automattic to decide to allow BuddyPress support. Your best bet might be to send feedback to Automattic suggesting they allow BuddyPress.
Master of Awesomeness 7:40 pm on April 10, 2012 Permalink
OK.
Chris Clayton 5:03 am on April 11, 2012 Permalink |
Sorry for spamming your update with unrelated stuff, Boone, thought i’d mention it here instead of spamming trac. but since i always miss devchats live (due to sleeping patterns) could someone remember to ask JJJ whether he had time to write the “to do” list for bbpress stuff promised last week? Love to see if theirs anything i can help with to get 1.6 in beta.
Paul Gibbs 5:57 pm on April 13, 2012 Permalink |
No, but it’s coming this weekend.