Making WordPress.org

Ticket #1972: meta-1972.2.patch

File meta-1972.2.patch, 2.5 KB (added by netweb, 7 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin.php

     
    3333         */
    3434        private function __construct() {
    3535                $this->performance = new Performance_Optimizations;
    36                 $this->users       = new Users;
    3736                $this->moderators  = new Moderators;
    3837                $this->hooks       = new Hooks;
    3938
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-users.php

     
    1 <?php
    2 
    3 namespace WordPressdotorg\Forums;
    4 
    5 class Users {
    6 
    7         public function __construct() {
    8                 add_filter( 'bbp_get_user_display_role', array( $this, 'display_role' ), 10, 2 );
    9         }
    10 
    11         /**
    12          * If the user has a custom title, use that instead of the forum role.
    13          *
    14          * @param string $role The user's forum role
    15          * @param int $user_id The user id
    16          * @return string The user's custom forum title, or their forum role
    17          */
    18         public function display_role( $role, $user_id ) {
    19                 $title = get_user_option( 'title', $user_id );
    20                 if ( ! empty( $title ) ) {
    21                         return esc_html( $title );
    22                 }
    23 
    24                 return $role;
    25         }
    26 }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/support-forums.php

    Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-users.php
    ___________________________________________________________________
    Deleted: svn:eol-style
    ## -1 +0,0 ##
    -native
    \ No newline at end of property
     
    1515
    1616// General includes.
    1717include( dirname( __FILE__ ) . '/inc/class-plugin.php' );
    18 include( dirname( __FILE__ ) . '/inc/class-users.php' );
    1918include( dirname( __FILE__ ) . '/inc/class-moderators.php' );
    2019include( dirname( __FILE__ ) . '/inc/class-hooks.php' );
    2120