WordPress.org

Making WordPress.org

Changeset 8879


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

WP I18N Teams: Respect the display_name field when set for slack user data.

See [8878].
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

    r8878 r8879  
    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             // Optional Display Name field
    586585            if ( !empty( $data['profile']['display_name'] ) && empty( $data['deleted'] ) ) {
     586                // Optional Display Name field.
    587587                $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'] ) ) {
     588            } elseif ( !empty( $data['profile']['real_name'] ) && empty( $data['deleted'] ) ) {
     589                // Fall back to "Full Name" field.
    592590                $slack_username = $data['profile']['real_name'];
    593591            }
Note: See TracChangeset for help on using the changeset viewer.