[buddypress-trac] [BuddyPress Trac] #6028: BP taxonomy wrapper functions

buddypress-trac noreply at wordpress.org
Tue Nov 18 21:33:30 UTC 2014


#6028: BP taxonomy wrapper functions
--------------------------+-----------------
 Reporter:  boonebgorges  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  2.2
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------
 See #4017, #6006

 We're currently planning a number of features that should take advantage
 of WP's taxonomy API. But the various ways that BuddyPress interacts with
 Multisite mean that we need wrappers for WP's functions, so that taxonomy
 data can always be stored in and read from the proper site's tables.

 In #4017, imath has suggested a framework for doing this. IMO, it adds a
 little bit more overhead than necessary. He has suggested procedural
 wrappers for static methods on a class loaded into the global object. But
 I don't think this provides any benefit over simple procedural wrapper,
 which would look like this:

 {{{
 function bp_get_terms( $taxonomies, $args = '' ) {
     switch_to_blog( bp_get_root_blog_id() );
     $retval = get_terms( $taxonomies, $args );
     restore_current_blog();

     return $retval;
 }
 }}}

 I also don't see a pressing reason to provide wrappers for every single
 function in WP's taxonomy API right off the bat. Instead, I think we can
 go the more conservative route of adding the wrappers as we need them for
 BP core functionality, or as requested by plugin authors.

 I suggest using the `bp_` function prefix, and putting everything in `bp-
 core/bp-core-taxonomy.php`. What do others think?

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


More information about the buddypress-trac mailing list