Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/12/2021 07:48:13 PM (4 years ago)
Author:
imath
Message:

Make sure all BP components init their BP Blocks

Even if some components don't have native BP Blocks, it makes it easier for developers to add their custom blocks or override existing BP Blocks or disable BP Blocks. Working on the BP Blocks feature as a plugin made us realize this.

This commit also improves the BP_Block constructor inline documentation, adds a new method to the Core component to register REST controllers and moves the BP_REST_Components_Endpoint one from the Members component to the Core component.

Fixes #8511

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-core.php

    r12753 r12994  
    352352        parent::register_post_types();
    353353    }
     354
     355    /**
     356     * Init the Core controllers of the BP REST API.
     357     *
     358     * @since 9.0.0
     359     *
     360     * @param array $controllers Optional. See BP_Component::rest_api_init() for
     361     *                           description.
     362     */
     363    public function rest_api_init( $controllers = array() ) {
     364        $controllers = array(
     365            'BP_REST_Components_Endpoint',
     366        );
     367
     368        parent::rest_api_init( $controllers );
     369    }
     370
     371    /**
     372     * Register the BP Core Blocks.
     373     *
     374     * @since 9.0.0
     375     *
     376     * @param array $blocks Optional. See BP_Component::blocks_init() for
     377     *                      description.
     378     */
     379    public function blocks_init( $blocks = array() ) {
     380        parent::blocks_init( array() );
     381    }
    354382}
Note: See TracChangeset for help on using the changeset viewer.