[buddypress-trac] [BuddyPress] #4891: datebox xprofile value is returned false when using bp_member_profile_data()
buddypress-trac
noreply at wordpress.org
Wed Mar 27 15:17:07 UTC 2013
#4891: datebox xprofile value is returned false when using
bp_member_profile_data()
-----------------------------------------+------------------------------
Reporter: imath | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Members | Version: 1.7
Severity: minor | Resolution:
Keywords: has-patch reporter-feedback |
-----------------------------------------+------------------------------
Comment (by imath):
Replying to [comment:1 DJPaul]:
> How does a datebox field end up with a integer timestamp instead of a
string for strtotime()?
Hi Paul, i thought as the filter
[http://buddypress.trac.wordpress.org/browser/trunk/bp-xprofile/bp-
xprofile-filters.php#L134 xprofile_filter_format_field_value] is using
this condition, there might be a reason. Maybe the datebox field was
stored as a timestamp in previous versions. As i had a doubt, i simply
used the same condition than the filter.
Actually, in the function
[http://buddypress.trac.wordpress.org/browser/trunk/bp-xprofile/bp-
xprofile-functions.php#L366 xprofile_format_profile_field()], if you
simply replace line 373 by
{{{
$field_value = bp_format_time( strtotime( $field_value ), true, false );
}}}
it displays the value as expected.
Another approach is to use the filter
[http://buddypress.trac.wordpress.org/browser/trunk/bp-xprofile/bp-
xprofile-filters.php#L51 bp_get_the_site_member_profile_data] that seems
to not being used by any function. In this case line 373 is becoming :
{{{
$field_value = apply_filters( 'bp_get_the_site_member_profile_data',
$field_value, $field_type );
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4891#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list