Making WordPress.org


Ignore:
Timestamp:
12/15/2022 06:17:22 AM (17 months ago)
Author:
dd32
Message:

Support Forums: Blocks: Avoid a PHP Notice when no forum is known (such as a user edit page).

See #6608.

File:
1 edited

Legend:

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

    r12330 r12331  
    277277        // Determine if the forum has the editor enabled.
    278278        $forum             = bbp_get_forum( bbp_get_forum_id() );
    279         $enabled_for_forum = ( 'enabled' === $forum->block_editor || ( ! $forum->block_editor && $this->forum_enabled_by_default ) );
     279        $enabled_for_forum = $forum ? ( 'enabled' === $forum->block_editor || ( ! $forum->block_editor && $this->forum_enabled_by_default ) ) : true;
    280280        $enabled_for_user  = ( 'disabled' !== $user_option );
    281281        $use_it            = ( $enabled_for_user && $enabled_for_forum );
Note: See TracChangeset for help on using the changeset viewer.