Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/25/2020 07:31:07 AM (5 years ago)
Author:
imath
Message:

Introduce the BP Blocks API into BP Core

  • The BP_Block class is wrapping the WP_Block_Type one to manage JavaScript and CSS assets registration and script translations.
  • To register a new BP Block, we are introducing a new function using this BP_Block class : bp_register_block().
  • Registering BP Blocks needs to happen hooking the bp_blocks_init action.
  • The BP_Component class now includes a new method BuddyPress components can use to register their blocks. It also makes sure this method is only usable if the BP REST API is available.
  • The dynamic filter bp_{component_id}_register_blocks let developers add or disable BP component blocks.
  • A dynamic action bp_{component_id}_blocks_init is fired once all corresponding BP component blocks has been registered.
  • The bp_blocks_editor_settings filter is gathering specific BuddyPress editor settings into a bp object.

See #8048

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/class-buddypress.php

    r12568 r12578  
    489489        require( $this->plugin_dir . 'bp-core/bp-core-customizer-email.php' );
    490490        require( $this->plugin_dir . 'bp-core/bp-core-rest-api.php'         );
     491        require( $this->plugin_dir . 'bp-core/bp-core-blocks.php'           );
    491492
    492493        // Maybe load deprecated functionality (this double negative is proof positive!).
     
    555556            'BP_Attachment'                              => 'core',
    556557            'BP_Button'                                  => 'core',
     558            'BP_Block'                                   => 'core',
    557559            'BP_Component'                               => 'core',
    558560            'BP_Customizer_Control_Range'                => 'core',
Note: See TracChangeset for help on using the changeset viewer.