[buddypress-trac] [BuddyPress] #4955: Improvements to BP_Group_Extension

buddypress-trac noreply at wordpress.org
Sun May 5 19:08:20 UTC 2013


#4955: Improvements to BP_Group_Extension
------------------------------+---------------------------
 Reporter:  boonebgorges      |       Owner:  boonebgorges
     Type:  task              |      Status:  new
 Priority:  high              |   Milestone:  1.8
Component:  Groups            |     Version:
 Severity:  major             |  Resolution:
 Keywords:  commit has-patch  |
------------------------------+---------------------------

Comment (by boonebgorges):

 In [changeset:"6997"]:
 {{{
 #!CommitTicketReference repository="" revision="6997"
 Refactor and reorganization of BP_Group_Extension

 The shiny new BP_Group_Extension class boasts the following features:

 - The *_screen* methods (edit_screen(), edit_screen_save(), etc) now share
   identical requirements for markup and logic. You no longer need to
 provide
   a Submit button for edit_screen() but not for create_screen();
 BuddyPress
   provides one for you in each context. (For backward compatibility, we
 verify
   that your edit_screen() method does not already have a Submit button
 before
   auto-adding our own.) Nonces are now created and checked automatically
 for
   all form contexts. And it is no longer necessary to check whether you
 are on
   the correct group creation or admin step before outputting your markup -
   BP_Group_Extension does it for you.
 - Introduces support for fallback methods settings_screen() and
   settings_screen_save(). When you define these methods in your extension,
 they
   will provide the markup and form-saving logic for your Create, Edit, and
   Admin panels. If you provide specific methods for a given context (say,
   edit_screen() and create_screen_save()), BP_Group_Extension detects it,
 and
   uses the more specific ones instead. This should make it much easier to
 write
   DRY code in your BP_Group_Extension classes, while maintaining maximum
   flexibility.
 - Configuration should now be set using a config array, which is then
 passed
   to parent::init() at the end of your class constructor. This technique
 more
   closely mirrors the way that BuddyPress and WordPress handle
 configuration
   elsewhere. BP_Group_Extension parses your config array to arbitrary
 depth, so
   that you only need to pass those values that you wish to change from the
   defaults.
 - Complete backward compatibility for legacy BP_Group_Extension plugins.
 - Improved organization, documentation, and unit tests.

 Props johnjamesjacoby for detailed feedback.

 See #4955
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4955#comment:12>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list