bbp_displayed_user_field

Output a sanitized user field value.

Description

bbp_displayed_user_field( (string) $field = '', (string) $filter = 'display' ); 

This function relies on the $filter parameter to decide how to sanitize the field value that it finds. Since it uses the WP_User object's magic __get() method, it can also be used to get user_meta values.

Parameters (2)

0. $field — Optional. (string) => ''
Field to get
1. $filter — Optional. (string) => 'display'
How to filter the field value (null|raw|db|display|edit)

Usage

  1. if ( !function_exists( 'bbp_displayed_user_field' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/users/template.php'; 
  3.  
  4. // Field to get 
  5. $field = ''; 
  6.  
  7. // How to filter the field value (null|raw|db|display|edit) 
  8. $filter = 'display'; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bbp_displayed_user_field($field, $filter); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/users/template.php  
  1. function bbp_displayed_user_field( $field = '', $filter = 'display' ) { 
  2. echo bbp_get_displayed_user_field( $field, $filter );