Making WordPress.org

Changeset 4045


Ignore:
Timestamp:
09/13/2016 02:32:47 PM (8 years ago)
Author:
jmdodd
Message:

Support Forums: Perform author sticky cap check against user login, not user id.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stickies-compat.php

    r4044 r4045  
    180180            $user_id = get_current_user_id();
    181181        }
     182        $user = get_userdata( $user_id );
    182183
    183184        if ( $topic_id ) {
     
    188189        }
    189190
    190         if ( $user_id && $topic && $term ) {
     191        if ( $user && $topic && $term ) {
    191192            // Moderators.
    192             if ( user_can( $user_id, 'moderate' ) ) {
     193            if ( user_can( $user->ID, 'moderate' ) ) {
    193194                $retval = true;
    194195            }
    195196
    196197            // Compat authors.
    197             if ( $this->authors && in_array( $user_id, $this->authors ) ) {
     198            if ( $this->authors && in_array( $user->user_login, $this->authors ) ) {
    198199                $retval = true;
    199200            }
Note: See TracChangeset for help on using the changeset viewer.