[buddypress-trac] [BuddyPress Trac] #6004: Move Avatar local management into new Attachments component

buddypress-trac noreply at wordpress.org
Mon Nov 10 23:21:21 UTC 2014

#6004: Move Avatar local management into new Attachments component
 Reporter:  imath        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  2.2
Component:  Avatars      |    Version:
 Severity:  normal       |   Keywords:  has-patch dev-feedback
 Relative to #5429

 This is a first pass to suggest a way to bring the Attachments into core.
 Following the discussions team had at WCSF, this patch is :
 1. creating a new component: Attachements
 2. moving functions relative to avatar local management into it
 (upload/crop/delete) for the xProfile and Groups components
 3. adding 2 new visible features :
  - managing group's avatar within the WordPress Group Administration
 screen (upload/crop/delete)
  - managing user's avatar within the WordPress Extended Profile
 Administration screen (upload/crop/delete)
 4. including the API i've been working on in the
 [https://github.com/buddypress/bp-attachments BP Attachments] plugin.

 So far i've tested points 1, 2, and 3. Depending on what will happen with
 this ticket, i plan to create a new branch for the
 [https://github.com/buddypress/bp-attachments BP Attachments] plugin to
 transform it into a demo plugin to explain how to use point 4. So point 4.
 will surely need some adjustements, i've left some @todos.

 I Think, this first step is a nice way to progressively insert some
 attachments management features. On front-end everything should work like
 before (which is limiting the risks IMHO), and we're improving some Admin
 management tools for community managers (deleting, editing or adding an
 avatar for a group or a user).

 The attachments component, just like the notifications one will
 automatically be activated on upgrade or install. It now holds the {{{bp-
 disable-avatar-uploads}}} setting. As it's used in one of the legacy
 templates ({{{bp-legacy/buddypress/members/single/profile/change-
 avatar.php}}}), if the component is deactivated, i thought it was safer to
 set this setting to true. I've tried to cover all back compat cases, to
 help me i've used this [https://docs.google.com/spreadsheets/d
 spreadsheet] (but i may have missed some).

 Improvements i can see :
 - have a different options for each avatar objects (user/group ... blog?)
 - function naming (especially in the "BP Attachments Editor", it's the
 script.js file using WP Backbone Views and Models)
 - try to make this more modular, i'm including all files. Some functions
 are specific to attachments, some others to avatar and some are used by
 both objects. The "BP Attachments Editor" includes attachments & avatars
 - in the plugin i was relying on terms to categorise attachments where
 component id => term slug. I've began using a mapping option just like
 components page to have component id => term id. I know there have been
 great improvements in WP Taxonomy API lately, but it may be safer to rely
 on ids.

 NB: The patch is including the patch i've made about the "w" cropping bug
 #5999 (it was a bit annoying to have the notices and i thought this
 function would move in the component anyway).

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6004>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list