Making WordPress.org

Changeset 6871


Ignore:
Timestamp:
03/13/2018 03:48:19 PM (8 years ago)
Author:
Otto42
Message:

Support Forums: Hide Bio information from users screen to non-logged in users, add nofollow to links therein

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-users.php

    r6303 r6871  
    1313        add_action( 'personal_options_update',         array( $this, 'save_custom_fields' ), 10, 2 );
    1414        add_action( 'edit_user_profile_update',        array( $this, 'save_custom_fields' ), 10, 2 );
     15
     16        // Adjust display of user fields
     17        add_filter( 'bbp_get_displayed_user_field',    array( $this, 'modify_user_fields' ), 10, 3 );
    1518
    1619        // Custom user contact methods.
     
    105108        update_user_option( $user_id, 'auto_topic_subscription', $auto_topic_subscription );
    106109    }
     110
     111    public function modify_user_fields( $value, $field, $filter ) {
     112        if ( $field === 'description'  && $filter === 'display' ) {
     113            if ( ! is_user_logged_in() ) {
     114                $value = '';
     115            } else {
     116                $value = bbp_rel_nofollow( $value );
     117            }
     118        }
     119        return $value;
     120    }   
    107121
    108122    /**
Note: See TracChangeset for help on using the changeset viewer.