Skip to:
Content

bbPress.org

Ticket #1999: users-template-tags.patch

File users-template-tags.patch, 1.2 KB (added by alex-ye, 13 years ago)
  • template-tags.php

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: \includes\users
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    129129         * @return string|bool Value of the field if it exists, else false
    130130         */
    131131        function bbp_get_displayed_user_field( $field = '' ) {
    132                 $bbp   = bbpress();
     132
    133133                $value = false;
    134134
    135                 // Return field if exists
    136                 if ( isset( $bbp->displayed_user->$field ) )
    137                         $value = esc_attr( sanitize_text_field( $bbp->displayed_user->$field ) );
     135                if ( !empty( $field ) ) {
     136                   
     137                        $bbp   = bbpress();
     138                       
     139                        // Return field if exists
     140                        if ( isset( $bbp->displayed_user->$field ) )
     141                                $value = $bbp->displayed_user->$field;
    138142
     143                }
     144
    139145                // Return empty
    140146                return apply_filters( 'bbp_get_displayed_user_field', $value, $field );
    141147        }