[buddypress-trac] [BuddyPress] #2952: Filter user meta keys

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Sun May 15 17:20:13 UTC 2011


#2952: Filter user meta keys
--------------------------+------------------------------------
  Reporter:  wpmuguru     |      Owner:  johnjamesjacoby
      Type:  enhancement  |     Status:  assigned
  Priority:  normal       |  Milestone:  1.3
 Component:  Core         |    Version:
Resolution:               |   Keywords:  has-patch dev-feedback
--------------------------+------------------------------------

Comment (by boonebgorges):

 I was thinking about this last night, and I decided that the initial
 approach that wpmuguru suggested is probably better.

 Attached is a huge patch 2952.3.diff that implements the change. It should
 be totally backward compatible. It means that plugin authors should change
 the way that their usermeta is saved, but if they don't, it won't break
 anything unless multi-network is turned on.

 The way things are structured in this patch, each meta key is run through
 its own filter bp_user_meta_keys-$key_name. It's also possible (and
 probably preferable) to hook a function to bp_setup_globals, with a high
 priority (maybe 999), and sweep through all of the meta_keys in one fell
 swoop:

 {{{
 foreach( $bp->user_meta_keys as $key_name => $key_value ) {
   // do your modifications
 }
 }}}

 It should be noted that the naming of the keys is inconsistent. Some start
 with bp_, while most do not. So bp-multi-network.php should probably be a
 bit more generous about how the prefixing works than it currently is.

 wpmuguru, it'd be great to get your feedback on this fairly soon, as the
 patch is likely to go stale. Thanks!

-- 
Ticket URL: <https://trac.buddypress.org/ticket/2952#comment:13>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list