Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/28/2014 06:23:15 PM (7 years ago)
Author:
djpaul
Message:

xProfile: fix profile fields not rendering if their value is "0".

This was caused by a reliance on the empty() function in a few places, which was causing us to
not handle "0" (both as int and string) as a valid field value. In turn, this was causing the
profile field template loop to skip rendering the affected field.

Fixes #5731, props DJPaul and r-a-y.

File:
1 edited

Legend:

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

    r8547 r8554  
    128128 */
    129129function xprofile_filter_format_field_value( $field_value, $field_type = '' ) {
    130     if ( !isset( $field_value ) || empty( $field_value ) )
     130    // Valid field values of 0 or '0' get caught by empty(), so we have an extra check for these. See #BP5731
     131    if ( ! isset( $field_value ) || empty( $field_value ) && '0' != $field_value )
    131132        return false;
    132133
Note: See TracChangeset for help on using the changeset viewer.