WordPress.org

Making WordPress.org

Changeset 8878


Ignore:
Timestamp:
05/27/2019 04:37:35 AM (8 weeks ago)
Author:
dd32
Message:

WP I18N Teams: Sync the code for determining a users slack username from profiles to the Translation Teams user listing.

Fixes #4464.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wp-i18n-teams/wp-i18n-teams.php

    r8781 r8878  
    583583        $data = $wpdb->get_var( $wpdb->prepare( "SELECT profiledata FROM slack_users WHERE user_id = %d", $user_id ) );
    584584        if ( $data && ( $data = json_decode( $data, true ) ) ) {
    585             if ( isset( $data['profile']['display_name'] ) ) {
     585            // Optional Display Name field
     586            if ( !empty( $data['profile']['display_name'] ) && empty( $data['deleted'] ) ) {
    586587                $slack_username = $data['profile']['display_name'];
     588            }
     589
     590            // Fall back to "Full Name" field.
     591            if ( !empty( $data['profile']['real_name'] ) && empty( $data['deleted'] ) ) {
     592                $slack_username = $data['profile']['real_name'];
    587593            }
    588594        }
Note: See TracChangeset for help on using the changeset viewer.