Making WordPress.org

Changeset 12575


Ignore:
Timestamp:
05/08/2023 02:52:06 AM (3 years ago)
Author:
dd32
Message:

Support Forums: Also Viewing: Handle Localised forums which do not have plugin/theme forums.

See [12574].
See #6431.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-also-viewing/wporg-bbp-also-viewing.php

    r12574 r12575  
    309309        foreach ( $users as &$u ) {
    310310                $user_objects = get_user_object_slugs( $u['user_id'] );
    311                 if ( ! array_intersect( $user_objects, $current_user_objects ) ) {
     311                if ( ! array_intersect( $current_user_objects, $user_objects ) ) {
    312312                        $u['who']     = '';
    313313                        $u['user_id'] = 0;
     
    329329        }
    330330
    331         $plugin_slugs = \WordPressdotorg\Forums\Plugin::get_instance()->plugins->get_user_object_slugs( $user_id );
    332         $theme_slugs  = \WordPressdotorg\Forums\Plugin::get_instance()->themes->get_user_object_slugs( $user_id );
     331        $forums = \WordPressdotorg\Forums\Plugin::get_instance();
     332        if ( ! $forums->plugins || ! $forums->themes ) {
     333                return [];
     334        }
     335
     336        $plugin_slugs = $forums->plugins->get_user_object_slugs( $user_id );
     337        $theme_slugs  = $forums->themes->get_user_object_slugs( $user_id );
    333338
    334339        $matrix = [];
Note: See TracChangeset for help on using the changeset viewer.