[buddypress-trac] [BuddyPress Trac] #4551: Use WP's metadata API

buddypress-trac noreply at wordpress.org
Sun Feb 9 02:08:20 UTC 2014

#4551: Use WP's metadata API
 Reporter:  sbrajesh                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  2.0
Component:  Core                                 |     Version:  1.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing 2nd-opinion  |
Changes (by boonebgorges):

 * keywords:  has-patch needs-refresh => has-patch needs-testing 2nd-opinion
 * milestone:  Future Release => 2.0


 4551.patch is a proof-of-concept for groupmeta. The strategy will apply
 directly to activitymeta and forummeta.

 Technical notes:

 - I have preserved all the quirks of the existing meta functions (like
 returning an unstructured array of values when passing a null meta key to
 groups_get_groupmeta()). My first goal is to get it working exactly like
 the existing functions, then we can worry about improvements.
 - To make WP see the table name, I put it into the $wpdb global, as DJPaul
 suggests above.
 - WP's functions hardcode `meta_id` into their SQL queries. We use `id`
 for our primary columns. To get around this, I introduce a little
 `str_replace()` filter (bp_filter_metaid_column_name()) that gets added to
 'query' just before we run the core function, and removed right after.
 This is the least elegant part of the patch, but it works well.
 - The functions now have pretty complete unit test coverage. 4551.patch
 passes the tests.

 Would like another set of eyes on this before moving on to the other

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4551#comment:13>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list