Making WordPress.org

Changeset 7603


Ignore:
Timestamp:
08/10/2018 09:57:32 PM (8 years ago)
Author:
SergeyBiryukov
Message:

WP i18n teams: Switch getting Slack username from deprecated name field to display_name.

See [7515] for Support Theme.
See ​https://api.slack.com/changelog/2017-09-the-one-about-usernames

File:
1 edited

Legend:

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

    r6537 r7603  
    573573                global $wpdb;
    574574
     575                $slack_username = '';
     576
    575577                $data = $wpdb->get_var( $wpdb->prepare( "SELECT profiledata FROM slack_users WHERE user_id = %d", $user_id ) );
    576578                if ( $data && ( $data = json_decode( $data, true ) ) ) {
    577                         return $data['name'];
    578                 }
    579 
    580                 return '';
     579                        if ( isset( $data['profile']['display_name'] ) ) {
     580                                $slack_username = $data['profile']['display_name'];
     581                        }
     582                }
     583
     584                return $slack_username;
    581585        }
    582586
Note: See TracChangeset for help on using the changeset viewer.