[buddypress-trac] [BuddyPress Trac] #5630: Enable BP_XProfile_Field_Type classes to register display filter
buddypress-trac
noreply at wordpress.org
Wed Jun 4 21:08:23 UTC 2014
#5630: Enable BP_XProfile_Field_Type classes to register display filter
-----------------------------------+------------------
Reporter: boonebgorges | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.1
Component: XProfile | Version:
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion |
-----------------------------------+------------------
Comment (by boonebgorges):
5630.03.patch cleans up some documentation, and marks the
`display_filter()` method static.
> Do you think we should somehow add a filter for display_filter, or do
you think it's ok for folks to just re-use the existing
bp_get_the_profile_field_value filter for that?
I spent a bit of time thinking about this. In theory, I would prefer to
apply the `display_filter()` formatting earlier in the chain, so that any
time someone got data out of an xprofile field, the filter would be
applied. But our current methods for fetching xprofile data are pretty
uneven. In the loop (`bp_get_the_profile_field_value()`) we do some weird
juggling with globals, and we (apparently) don't even unserialize until
the very last minute. Then there's `xprofile_get_field_data()`, which is
intended for use outside of the `bp_has_profile()` loop. It gets data from
a totally different pipeline
(`BP_XProfile_ProfileData::get_value_byid()`). I think it's a worthwhile
project to clean this all up at some point, but I don't think it's
necessary for the improvement currently under discussion.
All of that being said, 'bp_get_the_profile_field_value' does seem like
the right place to do the filtering, given the current order of
operations. I've also added a wrapper function that allows the filter to
be applied to `xprofile_get_field_data()`.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5630#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list