Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/09/2025 03:23:09 AM (8 months ago)
Author:
dd32
Message:

PHP8 compatibility: array_keys() only supports arrays, not null.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9/bb-includes/template-functions.php

    r7116 r7287  
    14381438function get_user_type( $id = 0 ) {
    14391439    if ( $user = bb_get_user( bb_get_user_id( $id ) ) ) :
    1440         @$caps = array_keys($user->capabilities);
     1440        $caps = ! empty( $user->capabilities ) ? array_keys( $user->capabilities ) : [];
    14411441        if ( !$caps )
    14421442            $caps[] = 'inactive';
Note: See TracChangeset for help on using the changeset viewer.