Skip to:
Content

bbPress.org

Changeset 4094


Ignore:
Timestamp:
07/20/2012 01:00:40 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Actions/Filters:

  • Add filter to bbp_get_displayed_user_field().
  • Fixes #1910.
  • For 2.2 branch.
  • Props iamzippy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-user-template.php

    r3978 r4094  
    125125     * @uses sanitize_text_field() To sanitize the field
    126126     * @uses esc_attr() To sanitize the field
     127     * @uses apply_filters() Calls 'bbp_get_displayed_user_field' with the value
    127128     * @return string|bool Value of the field if it exists, else false
    128129     */
    129130    function bbp_get_displayed_user_field( $field = '' ) {
    130         $bbp = bbpress();
     131        $bbp   = bbpress();
     132        $value = false;
    131133
    132134        // Return field if exists
    133135        if ( isset( $bbp->displayed_user->$field ) )
    134             return esc_attr( sanitize_text_field( $bbp->displayed_user->$field ) );
     136            $value = esc_attr( sanitize_text_field( $bbp->displayed_user->$field ) );
    135137
    136138        // Return empty
    137         return false;
     139        return apply_filters( 'bbp_get_displayed_user_field', $value, $field );
    138140    }
    139141
Note: See TracChangeset for help on using the changeset viewer.