Making WordPress.org

Changeset 7515


Ignore:
Timestamp:
07/27/2018 05:02:38 PM (6 years ago)
Author:
coffee2code
Message:

Support Theme: Switch getting Slack username from deprecated 'name' field to 'display_name'.

See https://api.slack.com/changelog/2017-09-the-one-about-usernames
Fixes https://wordpress.slack.com/archives/C02QB8GMM/p1532683032000246

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r7455 r7515  
    205205    $data = $wpdb->get_var( $wpdb->prepare( "SELECT profiledata FROM slack_users WHERE user_id = %d", $user_id ) );
    206206    if ( $data && ( $data = json_decode( $data, true ) ) ) {
    207         $slack_username = $data['name'];
     207        if ( isset( $data['profile']['display_name'] ) ) {
     208            $slack_username = $data['profile']['display_name'];
     209        }
    208210    }
    209211
Note: See TracChangeset for help on using the changeset viewer.