BuddyPress contributors are polishing up new and existing APIs for the upcoming 2.3 release. For the past several months, core developer Mathieu Viet (@imath) has been spearheading the effort to get the new Attachments API ready for 2.3 with the help of contributions and feedback from the core team.
The Attachments API is a new library that will allow developers to create components that have the ability to manage uploads. The first example of this API in action is a vastly improved core interface for uploading, cropping, and setting profile photos for users and groups. This new extensible avatar UI landed in BP trunk yesterday.
As you can see below, the new interface allows for the traditional image upload. It also adds the ability for users to access their device camera to capture a profile photo, if they are using a browser that supports getUserMedia.
Administrators can also easily edit a member’s profile photo from the extended profile screen in the admin.
For those who prefer the legacy interface, you can use a filter to disable the new UI. This allows you to still keep your BuddyPress core updated, even if you don’t want to add the new avatar interface to your community. Check out @imath’s post on the BuddyPress development blog for details on using the filter, as well as more information on the applicable templates and theme compatibility.
One of the most exciting things about the new avatar UI is that plugin developers can easily extend it for their own unique purposes.
“Regarding extensibility: In the long run, we want plugins to be able to add their own versions of the uploader, ideally with a minimal amount of work,” BP lead developer Boone Gorges said in discussion on the ticket. “@imath has already demonstrated that it’s not too difficult, and in the future I imagine that we’ll discover ways to make it even easier.”
Gorges emphasized that the focus at the moment is to build a solid replacement for the avatar upload system in 2.3 and then work on continually improving the API over time.
Check out the roadmap to view other specific tickets that are in progress for the 2.3 release, which should be available in six weeks at the end of May.