[buddypress-trac] [BuddyPress Trac] #6125: Small improvements to Member Types functions

buddypress-trac noreply at wordpress.org
Thu Jan 15 20:46:17 UTC 2015

#6125: Small improvements to Member Types functions
 Reporter:  Offereins     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.2
Component:  Members       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |

Comment (by boonebgorges):

 Thanks, Offereins and johnjamesjacoby.

 > Checking for type (array key) existence with empty() instead of isset()

 This is copied right from `get_post_type_object()`. There should be no
 natural case in which a member type key is set to an empty value (like an
 empty string). That being said, there's no harm in making the change to

 > Looking at this more makes me think the bp_get_member_types() function
 is doing too much compared to other similar utility functions.
 6125.02.patch simplifies bp_get_member_types() and introduces another
 helper to filter those results if it ever becomes necessary.

 One of the goals here was to make the API look exactly like WP's post type
 API. So `bp_get_member_types()` has a function signature identical to
 `get_post_types()`. Unless there's a powerful argument to the contrary
 (like a bug that it introduces), I'd prefer not to break the filter logic
 out into a separate function.

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

More information about the buddypress-trac mailing list