Skip to:
Content

BuddyPress.org

Changeset 8689


Ignore:
Timestamp:
07/24/2014 06:45:49 AM (5 years ago)
Author:
imath
Message:

Make sure xprofile_format_profile_field() returns a well formatted value in case of a datebox field.

This function is now using the display_filter() filters as defined by the corresponding BP_XProfile_Field_Type classes.

Props wbajzek, shanebp.

Fixes #4365

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r8675 r8689  
    489489 * @param string $field_type The type of field: datebox, selectbox, textbox etc
    490490 * @param string $field_value The actual value
    491  * @uses bp_format_time() Formats a time value based on the WordPress date format setting
    492491 * @return string|bool The formatted value, or false if value is empty
    493492 */
     
    498497    $field_value = bp_unserialize_profile_field( $field_value );
    499498
    500     if ( 'datebox' == $field_type ) {
    501         $field_value = bp_format_time( $field_value, true );
    502     } else {
     499    if ( 'datebox' != $field_type ) {
    503500        $content = $field_value;
    504501        $field_value = str_replace( ']]>', ']]>', $content );
    505502    }
    506503
    507     return stripslashes_deep( $field_value );
     504    return xprofile_filter_format_field_value_by_type( stripslashes_deep( $field_value ), $field_type );
    508505}
    509506
Note: See TracChangeset for help on using the changeset viewer.