Making WordPress.org


Ignore:
Timestamp:
07/18/2023 05:41:27 AM (18 months ago)
Author:
dd32
Message:

Support Forums: Moderators: Allow moderators on the English forums to block users.

Fixes #5707.

File:
1 edited

Legend:

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

    r12292 r12747  
    4242
    4343    /**
     44     * Define whether this is the global forums, or a locale forum.
     45     * ie. https://wordpress.org/support/
     46     *
     47     * @var bool
     48     */
     49    public $is_main_forums = false;
     50
     51    /**
    4452     * Always return the same instance of this plugin.
    4553     *
     
    6775        $this->audit_log    = new Audit_Log;
    6876
     77        // Set a flag to indicate whether this is the global forums, or a locale forum.
     78        $this->is_main_forums = (
     79            defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) &&
     80            WPORG_SUPPORT_FORUMS_BLOGID == get_current_blog_id()
     81        );
     82
    6983        // These modifications are specific to https://wordpress.org/support/
    70         $blog_id = get_current_blog_id();
    71         if ( $blog_id && defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) && WPORG_SUPPORT_FORUMS_BLOGID == $blog_id ) {
     84        if ( $this->is_main_forums ) {
    7285            $this->dropin          = new Dropin;
    7386            $this->support_compat  = new Support_Compat;
    7487
    7588            // Only load Performance_Optimizations if necessary.
    76             $this->performance = new Performance_Optimizations;
     89            $this->performance     = new Performance_Optimizations;
    7790
    7891            // Ratings_Compat is loaded by Theme_Directory_Compat or
     
    8295        }
    8396
     97        // Only load the Block Support if the Blocks Everywhere plugin is available.
    8498        if ( class_exists( 'Automattic\Blocks_Everywhere\Blocks_Everywhere' ) ) {
    85             $this->blocks = new Blocks;
     99            $this->blocks          = new Blocks;
    86100        }
    87101
Note: See TracChangeset for help on using the changeset viewer.