Skip to:
Content

BuddyPress.org

Ticket #8511: 8511.patch

File 8511.patch, 8.8 KB (added by imath, 4 years ago)
  • src/bp-blogs/classes/class-bp-blogs-component.php

    diff --git src/bp-blogs/classes/class-bp-blogs-component.php src/bp-blogs/classes/class-bp-blogs-component.php
    index 9ad5e6d1f..fa4bae095 100644
    class BP_Blogs_Component extends BP_Component { 
    379379
    380380                parent::rest_api_init( $controllers );
    381381        }
     382
     383        /**
     384         * Register the BP Blogs Blocks.
     385         *
     386         * @since 9.0.0
     387         *
     388         * @param array $blocks Optional. See BP_Component::blocks_init() for
     389         *                      description.
     390         */
     391        public function blocks_init( $blocks = array() ) {
     392                parent::blocks_init( array() );
     393        }
    382394}
  • src/bp-core/classes/class-bp-block.php

    diff --git src/bp-core/classes/class-bp-block.php src/bp-core/classes/class-bp-block.php
    index baf31c837..b361ee5a0 100644
    class BP_Block { 
    4747         *
    4848         * @since 6.0.0
    4949         *
    50          * @param array $args The registration arguments for the BP Block.
     50         * @param array $args {
     51         *     The registration arguments for the BP Block. Part of the arguments are the ones
     52         *     used by `WP_Block_Type`. Below are BP specific arguments.
     53         *
     54         *     @type string $name               The name of the block (eg: `bp/member`).
     55         *     @type string $editor_script_url  URL to the JavaScript main file of the BP Block
     56         *                                      to load into the Block Editor.
     57         *     @type array  $editor_script_deps The list of JavaScript dependency handles for the
     58         *                                      BP Block main file.
     59         *     @type string $script_url         URL to the JavaScript file to load into the Block
     60         *                                      Editor and on front-end.
     61         *     @type array  $script_deps        The list of JavaScript dependency handles for the
     62         *                                      JavaScript file to load into the Block Editor and
     63         *                                      on front-end.
     64         *     @type string $editor_style_url   URL to the CSS main file of the BP Block to load
     65         *                                      into the Block Editor.
     66         *     @type array  $editor_style_deps  The list of CSS dependency handles for the
     67         *                                      CSS main file.
     68         *     @type string $style_url          URL to the CSS file to load into the Block Editor
     69         *                                      and on front-end.
     70         *     @type array  $style_deps         The list of CSS dependency handles for the CSS file
     71         *                                      to load into the Block Editor and on front-end.
     72         * }
    5173         */
    5274        public function __construct( $args ) {
    5375                if ( ! did_action( 'bp_blocks_init' ) ) {
  • src/bp-core/classes/class-bp-component.php

    diff --git src/bp-core/classes/class-bp-component.php src/bp-core/classes/class-bp-component.php
    index ee3dfde6d..23ef1cbc5 100644
    class BP_Component { 
    917917         *
    918918         * @since 6.0.0
    919919         *
     920         * @see `BP_Block->construct()` for a full description of a BP Block arguments.
     921         *
    920922         * @param array $blocks The list of BP Blocks to register.
    921923         */
    922924        public function blocks_init( $blocks = array() ) {
    923                 if ( is_array( $blocks ) && $blocks ) {
    924                         /**
    925                          * Filter here to disable all or some BP Blocks for a component.
    926                          *
    927                          * This is a dynamic hook that is based on the component string ID.
    928                          *
    929                          * @since 6.0.0
    930                          *
    931                          * @param array $blocks The list of BP Blocks for the component.
    932                          */
    933                         $blocks = (array) apply_filters( 'bp_' . $this->id . '_register_blocks', $blocks );
     925                /**
     926                 * Filter here to add new BP Blocks, disable some or all BP Blocks for a component.
     927                 *
     928                 * This is a dynamic hook that is based on the component string ID.
     929                 *
     930                 * @since 6.0.0
     931                 *
     932                 * @param array $blocks The list of BP Blocks for the component.
     933                 */
     934                $blocks = (array) apply_filters( 'bp_' . $this->id . '_register_blocks', $blocks );
     935                $blocks = array_filter( $blocks );
    934936
     937                if ( $blocks ) {
    935938                        foreach ( $blocks as $block ) {
    936939                                bp_register_block( $block );
    937940                        }
  • src/bp-core/classes/class-bp-core.php

    diff --git src/bp-core/classes/class-bp-core.php src/bp-core/classes/class-bp-core.php
    index ca6fa8b2d..6030eb0e0 100644
    class BP_Core extends BP_Component { 
    351351
    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}
  • src/bp-friends/classes/class-bp-friends-component.php

    diff --git src/bp-friends/classes/class-bp-friends-component.php src/bp-friends/classes/class-bp-friends-component.php
    index d29f416dd..29594f04a 100644
    class BP_Friends_Component extends BP_Component { 
    337337        public function rest_api_init( $controllers = array() ) {
    338338                parent::rest_api_init( array( 'BP_REST_Friends_Endpoint' ) );
    339339        }
     340
     341        /**
     342         * Register the BP Friends Blocks.
     343         *
     344         * @since 9.0.0
     345         *
     346         * @param array $blocks Optional. See BP_Component::blocks_init() for
     347         *                      description.
     348         */
     349        public function blocks_init( $blocks = array() ) {
     350                parent::blocks_init( array() );
     351        }
    340352}
  • src/bp-members/classes/class-bp-members-component.php

    diff --git src/bp-members/classes/class-bp-members-component.php src/bp-members/classes/class-bp-members-component.php
    index 6355fbfe6..312a0ceca 100644
    class BP_Members_Component extends BP_Component { 
    695695         *
    696696         * @since 5.0.0
    697697         * @since 6.0.0 Adds the Member Cover and Signup REST endpoints.
     698         * @since 9.0.0 Moves the `BP_REST_Components_Endpoint` controller in `BP_Core` component.
    698699         *
    699700         * @param array $controllers Optional. See BP_Component::rest_api_init() for
    700701         *                           description.
    701702         */
    702703        public function rest_api_init( $controllers = array() ) {
    703704                $controllers = array(
    704                         /**
    705                          * As the Members component is always loaded,
    706                          * let's register the Components endpoint here.
    707                          */
    708                         'BP_REST_Components_Endpoint',
    709705                        'BP_REST_Members_Endpoint',
    710706                        'BP_REST_Attachments_Member_Avatar_Endpoint',
    711707                );
  • src/bp-messages/classes/class-bp-messages-component.php

    diff --git src/bp-messages/classes/class-bp-messages-component.php src/bp-messages/classes/class-bp-messages-component.php
    index 1904bd98c..f04c00c50 100644
    class BP_Messages_Component extends BP_Component { 
    445445        public function rest_api_init( $controllers = array() ) {
    446446                parent::rest_api_init( array( 'BP_REST_Messages_Endpoint' ) );
    447447        }
     448
     449        /**
     450         * Register the BP Messages Blocks.
     451         *
     452         * @since 9.0.0
     453         *
     454         * @param array $blocks Optional. See BP_Component::blocks_init() for
     455         *                      description.
     456         */
     457        public function blocks_init( $blocks = array() ) {
     458                parent::blocks_init( array() );
     459        }
    448460}
  • src/bp-settings/classes/class-bp-settings-component.php

    diff --git src/bp-settings/classes/class-bp-settings-component.php src/bp-settings/classes/class-bp-settings-component.php
    index e48747f81..383d5cf25 100644
    class BP_Settings_Component extends BP_Component { 
    292292
    293293                parent::setup_admin_bar( $wp_admin_nav );
    294294        }
     295
     296        /**
     297         * Register the BP Settings Blocks.
     298         *
     299         * @since 9.0.0
     300         *
     301         * @param array $blocks Optional. See BP_Component::blocks_init() for
     302         *                      description.
     303         */
     304        public function blocks_init( $blocks = array() ) {
     305                parent::blocks_init( array() );
     306        }
    295307}
  • src/bp-xprofile/classes/class-bp-xprofile-component.php

    diff --git src/bp-xprofile/classes/class-bp-xprofile-component.php src/bp-xprofile/classes/class-bp-xprofile-component.php
    index 2976fdf5a..305ebea94 100644
    class BP_XProfile_Component extends BP_Component { 
    456456                        'BP_REST_XProfile_Data_Endpoint',
    457457                ) );
    458458        }
     459
     460        /**
     461         * Register the BP xProfile Blocks.
     462         *
     463         * @since 9.0.0
     464         *
     465         * @param array $blocks Optional. See BP_Component::blocks_init() for
     466         *                      description.
     467         */
     468        public function blocks_init( $blocks = array() ) {
     469                parent::blocks_init( array() );
     470        }
    459471}