Changeset 4144
- Timestamp:
- 09/27/2016 07:21:03 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-users.php
r4143 r4144 6 6 7 7 public function __construct() { 8 // If the user has a custom title, use that instead of the forum role.9 add_filter( 'bbp_get_user_display_role', array( $this, 'display_role' ), 10, 2 );10 11 8 // Add a Custom Title input to user's profile. 12 9 add_action( 'bbp_user_edit_after_name', array( $this, 'add_custom_title_input' ) ); … … 18 15 // Custom user contact methods. 19 16 add_filter( 'user_contactmethods', array( $this, 'custom_contact_methods' ) ); 20 }21 22 /**23 * If the user has a custom title, use that instead of the forum role.24 *25 * @param string $role The user's forum role.26 * @param int $user_id The user ID.27 * @return string The user's custom forum title, or their forum role.28 */29 public function display_role( $role, $user_id ) {30 $title = get_user_option( 'title', $user_id );31 if ( ! empty( $title ) ) {32 return esc_html( $title );33 }34 35 return $role;36 17 } 37 18
Note: See TracChangeset
for help on using the changeset viewer.