[buddypress-trac] [BuddyPress Trac] #5220: Overhaul implementation of xprofile field types

buddypress-trac noreply at wordpress.org
Tue Feb 25 16:42:51 UTC 2014

#5220: Overhaul implementation of xprofile field types
 Reporter:  DJPaul       |       Owner:  DJPaul
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  2.0
Component:  XProfile     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  early        |

Comment (by boonebgorges):

 It's hard to know what kind of restructuring would work without knowing
 more about how your rewrite works. If you're planning to eliminate the
 function altogether, I think it'd be something like this (and this is what
 I assume the comment means):

 add_filter( 'bp_get_member_profile_data', 'bp_unserialize_profile_field'
 add_filter( 'bp_get_member_profile_data', 'stripslashes_deep' );

 Probably will also want to pass the field type along to the
 'bp_get_member_profile_data' filter, and then have specific filter
 callbacks that detect type before bailing out. Alternatively, you could
 have dynamic filters:

 $data = apply_filters( 'bp_get_member_profile_data', $data );
 $data = apply_filters( 'bp_get_member_profile_data_' . $type, $data );

 then add type-specific filters

 add_filter( 'bp_get_member_profile_data_datebox', 'bp_format_time' );

 Does that help?

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

More information about the buddypress-trac mailing list