<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][12578] trunk/src: Introduce the BP Blocks API into BP Core</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/12578">12578</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/12578","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-03-25 07:31:07 +0000 (Wed, 25 Mar 2020)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="http://buddypress.trac.wordpress.org/ticket/8048">#8048</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpcorebpcoreactionsphp">trunk/src/bp-core/bp-core-actions.php</a></li>
<li><a href="#trunksrcbpcorebpcoredependencyphp">trunk/src/bp-core/bp-core-dependency.php</a></li>
<li><a href="#trunksrcbpcoreclassesclassbpcomponentphp">trunk/src/bp-core/classes/class-bp-component.php</a></li>
<li><a href="#trunksrcclassbuddypressphp">trunk/src/class-buddypress.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcbpcorebpcoreblocksphp">trunk/src/bp-core/bp-core-blocks.php</a></li>
<li><a href="#trunksrcbpcoreclassesclassbpblockphp">trunk/src/bp-core/classes/class-bp-block.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpcorebpcoreactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-actions.php     2020-03-25 07:08:21 UTC (rev 12577)
+++ trunk/src/bp-core/bp-core-actions.php       2020-03-25 07:31:07 UTC (rev 12578)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,6 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_init', 'bp_setup_canonical_stack',   5  );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_init', 'bp_setup_nav',               6  );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_init', 'bp_setup_title',             8  );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'bp_init', 'bp_blocks_init',             10 );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_init', 'bp_core_load_admin_bar_css', 12 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_init', 'bp_add_rewrite_tags',        20 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_init', 'bp_add_rewrite_rules',       30 );
</span></span></pre></div>
<a id="trunksrcbpcorebpcoreblocksphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/bp-core/bp-core-blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-blocks.php                              (rev 0)
+++ trunk/src/bp-core/bp-core-blocks.php        2020-03-25 07:31:07 UTC (rev 12578)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,69 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Core BP Blocks functions.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ * @since 6.0.0
+ */
+
+// Exit if accessed directly.
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Registers the BP Block components.
+ *
+ * @since 6.0.0
+ */
+function bp_register_block_components() {
+       wp_register_script(
+               'bp-block-components',
+               plugins_url( 'js/block-components.js', __FILE__ ),
+               array(
+                       'wp-element',
+                       'wp-components',
+                       'wp-i18n',
+                       'wp-api-fetch',
+               ),
+               bp_get_version()
+       );
+}
+add_action( 'bp_blocks_init', 'bp_register_block_components', 1 );
+
+/**
+ * Filters the Block Editor settings to gather BuddyPress ones into a `bp` key.
+ *
+ * @since 6.0.0
+ *
+ * @param array $editor_settings Default editor settings.
+ * @return array The editor settings including BP blocks specific ones.
+ */
+function bp_blocks_editor_settings( $editor_settings = array() ) {
+       /**
+        * Filter here to include your BP Blocks specific settings.
+        *
+        * @since 6.0.0
+        *
+        * @param array $bp_editor_settings BP blocks specific editor settings.
+        */
+       $bp_editor_settings = (array) apply_filters( 'bp_blocks_editor_settings', array() );
+
+       if ( $bp_editor_settings ) {
+               $editor_settings['bp'] = $bp_editor_settings;
+       }
+
+       return $editor_settings;
+}
+add_filter( 'block_editor_settings', 'bp_blocks_editor_settings' );
+
+/**
+ * Register a BuddyPress block type.
+ *
+ * @since 6.0.0
+ *
+ * @param array $args The registration arguments for the block type.
+ * @return BP_Block   The BuddyPress block type object.
+ */
+function bp_register_block( $args = array() ) {
+       return new BP_Block( $args );
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/bp-core/bp-core-blocks.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcbpcorebpcoredependencyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-dependency.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-dependency.php  2020-03-25 07:08:21 UTC (rev 12577)
+++ trunk/src/bp-core/bp-core-dependency.php    2020-03-25 07:31:07 UTC (rev 12578)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,6 +268,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * BP Blocks Init hook.
+ *
+ * @since 6.0.0
+ */
+function bp_blocks_init() {
+       /**
+        * Hook here to register your BuddyPress blocks.
+        *
+        * @since 6.0.0
+        */
+       do_action( 'bp_blocks_init' );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * Fire the 'bp_customize_register' action when the Customizer has loaded,
</span><span class="cx" style="display: block; padding: 0 10px">  * allowing scripts and styles to be initialized.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span></span></pre></div>
<a id="trunksrcbpcoreclassesclassbpblockphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/bp-core/classes/class-bp-block.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/classes/class-bp-block.php                              (rev 0)
+++ trunk/src/bp-core/classes/class-bp-block.php        2020-03-25 07:31:07 UTC (rev 12578)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,197 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * BP Block class.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ * @since 6.0.0
+ */
+
+// Exit if accessed directly.
+if ( ! defined( 'ABSPATH' ) ) {
+       exit;
+}
+
+/**
+ * BP Block Class.
+ *
+ * @since 6.0.0
+ */
+class BP_Block {
+       /**
+        * WP Block Type object.
+        *
+        * @since 6.0.0
+        * @var WP_Block_Type|WP_Error
+        */
+       public $block;
+
+       /**
+        * The script types registered.
+        *
+        * @since 6.0.0
+        * @var array
+        */
+       private $registered_scripts;
+
+       /**
+        * The style types registered.
+        *
+        * @since 6.0.0
+        * @var array
+        */
+       private $registered_styles;
+
+       /**
+        * Construct the BuddyPress Block.
+        *
+        * @since 6.0.0
+        *
+        * @param array $args The registration arguments for the BP Block.
+        */
+       public function __construct( $args ) {
+               if ( ! did_action( 'bp_blocks_init' ) ) {
+                       _doing_it_wrong( __METHOD__, esc_html__( 'BP Blocks needs to be registered hooking `bp_blocks_init`', 'buddypress' ), '6.0.0' );
+               }
+
+               $min     = bp_core_get_minified_asset_suffix();
+               $wp_args = array_intersect_key(
+                       $args,
+                       array(
+                               'name'            => '',
+                               'render_callback' => '',
+                               'attributes'      => '',
+                               'editor_script'   => '',
+                               'script'          => '',
+                               'editor_style'    => '',
+                               'style'           => '',
+                       )
+               );
+
+               if ( ! isset( $wp_args['name'] ) || ! $wp_args['name'] || ! isset( $wp_args['editor_script'] ) || ! $wp_args['editor_script'] ) {
+                       $this->block = new WP_Error( 'missing_parameters', __( 'The `name` or `editor_script` required keys are missing.', 'buddypress' ) );
+               } else {
+                       // Get specific BP Blocks arguments.
+                       $bp_args = array_intersect_key(
+                               $args,
+                               array(
+                                       'editor_script_url'  => '',
+                                       'editor_script_deps' => array(),
+                                       'script_url'         => '',
+                                       'script_deps'        => array(),
+                                       'editor_style_url'   => '',
+                                       'editor_style_deps'  => array(),
+                                       'style_url'          => '',
+                                       'style_deps'         => array(),
+                               )
+                       );
+
+                       // Register the scripts.
+                       $version                  = bp_get_version();
+                       $this->registered_scripts = array();
+
+                       foreach ( array( 'editor_script', 'script' ) as $script_handle_key ) {
+                               if ( ! isset( $wp_args[ $script_handle_key ] ) || ! $wp_args[ $script_handle_key ] ) {
+                                       continue;
+                               }
+
+                               if ( ! isset( $bp_args[ $script_handle_key . '_url' ] ) || ! $bp_args[ $script_handle_key . '_url' ] ) {
+                                       continue;
+                               }
+
+                               $deps = array();
+                               if ( isset( $bp_args[ $script_handle_key . '_deps' ] ) && is_array( $bp_args[ $script_handle_key . '_deps' ] ) ) {
+                                       $deps = $bp_args[ $script_handle_key . '_deps' ];
+                               }
+
+                               $this->registered_scripts[ $script_handle_key ] = wp_register_script(
+                                       $wp_args[ $script_handle_key ],
+                                       $bp_args[ $script_handle_key . '_url' ],
+                                       $deps,
+                                       $version,
+                                       true
+                               );
+                       }
+
+                       if ( ! isset( $this->registered_scripts['editor_script'] ) || ! $this->registered_scripts['editor_script'] ) {
+                               $this->block = new WP_Error( 'script_registration_error', __( 'The required `editor_script` could not be registered.', 'buddypress' ) );
+                       } else {
+                               // Register the styles.
+                               $registered_styles = array();
+
+                               foreach ( array( 'editor_style', 'style' ) as $style_handle_key ) {
+                                       if ( ! isset( $wp_args[ $style_handle_key ] ) || ! $wp_args[ $style_handle_key ] ) {
+                                               continue;
+                                       }
+
+                                       if ( ! isset( $bp_args[ $style_handle_key . '_url' ] ) || ! $bp_args[ $style_handle_key . '_url' ] ) {
+                                               continue;
+                                       }
+
+                                       if ( $min ) {
+                                               $minified_css  = str_replace( '.css', $min . '.css', $bp_args[ $style_handle_key . '_url' ] );
+                                               $css_file_path = str_replace( content_url(), WP_CONTENT_DIR, $minified_css );
+
+                                               if ( file_exists( $css_file_path ) ) {
+                                                       $bp_args[ $style_handle_key . '_url' ] = $minified_css;
+                                               }
+                                       }
+
+                                       $deps = array();
+                                       if ( isset( $bp_args[ $style_handle_key . '_deps' ] ) && is_array( $bp_args[ $style_handle_key . '_deps' ] ) ) {
+                                               $deps = $bp_args[ $style_handle_key . '_deps' ];
+                                       }
+
+                                       $this->registered_styles[ $style_handle_key ] = wp_register_style(
+                                               $wp_args[ $style_handle_key ],
+                                               $bp_args[ $style_handle_key . '_url' ],
+                                               $deps,
+                                               $version
+                                       );
+
+                                       wp_style_add_data( $wp_args[ $style_handle_key ], 'rtl', 'replace' );
+                                       if ( $min ) {
+                                               wp_style_add_data( $wp_args[ $style_handle_key ], 'suffix', $min );
+                                       }
+                               }
+
+                               $name = $wp_args['name'];
+                               unset( $wp_args['name'] );
+
+                               // Set the Block Type.
+                               $this->block = new WP_Block_Type( $name, $wp_args );
+
+                               // Register the Block Type.
+                               register_block_type( $this->block );
+
+                               // Load Block translations if found.
+                               if ( $this->block->editor_script ) {
+                                       /**
+                                        * Filter here to use a custom directory to look for the JSON translation file into.
+                                        *
+                                        * @since 6.0.0
+                                        *
+                                        * @param string $value         Absolute path to the directory to look for the JSON translation file into.
+                                        * @param string $editor_script The editor's script handle.
+                                        * @param string $name          The block's name.
+                                        */
+                                       $translation_dir = apply_filters( 'bp_block_translation_dir', null, $this->block->editor_script, $name );
+
+                                       /**
+                                        * Filter here to use a custom domain for the JSON translation file.
+                                        *
+                                        * @since 6.0.0
+                                        *
+                                        * @param string $value         The custom domain for the JSON translation file.
+                                        * @param string $editor_script The editor's script handle.
+                                        * @param string $name          The block's name.
+                                        */
+                                       $domain = apply_filters( 'bp_block_translation_dir', 'buddypress', $this->block->editor_script, $name );
+
+                                       // Try to load the translation.
+                                       $translated = wp_set_script_translations( $this->block->editor_script, $domain, $translation_dir );
+                               }
+                       }
+               }
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/bp-core/classes/class-bp-block.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcbpcoreclassesclassbpcomponentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/classes/class-bp-component.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/classes/class-bp-component.php  2020-03-25 07:08:21 UTC (rev 12577)
+++ trunk/src/bp-core/classes/class-bp-component.php    2020-03-25 07:31:07 UTC (rev 12578)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -466,6 +466,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        add_action( 'bp_rest_api_init', array( $this, 'rest_api_init' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // Register BP Blocks.
+               if ( bp_rest_api_is_available() ) {
+                       add_action( 'bp_blocks_init', array( $this, 'blocks_init' ), 10 );
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 /**
</span><span class="cx" style="display: block; padding: 0 10px">                 * Fires at the end of the setup_actions method inside BP_Component.
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -906,5 +911,40 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                do_action( 'bp_' . $this->id . '_rest_api_init' );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       /**
+        * Register the BP Blocks.
+        *
+        * @since 6.0.0
+        *
+        * @param array $blocks The list of BP Blocks to register.
+        */
+       public function blocks_init( $blocks = array() ) {
+               if ( is_array( $blocks ) && $blocks ) {
+                       /**
+                        * Filter here to disable all or some BP Blocks for a component.
+                        *
+                        * This is a dynamic hook that is based on the component string ID.
+                        *
+                        * @since 6.0.0
+                        *
+                        * @param array $blocks The list of BP Blocks for the component.
+                        */
+                       $blocks = (array) apply_filters( 'bp_' . $this->id . '_register_blocks', $blocks );
+
+                       foreach ( $blocks as $block ) {
+                               bp_register_block( $block );
+                       }
+               }
+
+               /**
+                * Fires in the blocks_init method inside BP_Component.
+                *
+                * This is a dynamic hook that is based on the component string ID.
+                *
+                * @since 6.0.0
+                */
+               do_action( 'bp_' . $this->id . '_blocks_init' );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> endif; // BP_Component.
</span></span></pre></div>
<a id="trunksrcclassbuddypressphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/class-buddypress.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/class-buddypress.php    2020-03-25 07:08:21 UTC (rev 12577)
+++ trunk/src/class-buddypress.php      2020-03-25 07:31:07 UTC (rev 12578)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -488,6 +488,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                require( $this->plugin_dir . 'bp-core/bp-core-loader.php'           );
</span><span class="cx" style="display: block; padding: 0 10px">                require( $this->plugin_dir . 'bp-core/bp-core-customizer-email.php' );
</span><span class="cx" style="display: block; padding: 0 10px">                require( $this->plugin_dir . 'bp-core/bp-core-rest-api.php'         );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                require( $this->plugin_dir . 'bp-core/bp-core-blocks.php'           );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Maybe load deprecated functionality (this double negative is proof positive!).
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! bp_get_option( '_bp_ignore_deprecated_code', ! $this->load_deprecated ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -554,6 +555,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'BP_Attachment_Cover_Image'                  => 'core',
</span><span class="cx" style="display: block; padding: 0 10px">                        'BP_Attachment'                              => 'core',
</span><span class="cx" style="display: block; padding: 0 10px">                        'BP_Button'                                  => 'core',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'BP_Block'                                   => 'core',
</ins><span class="cx" style="display: block; padding: 0 10px">                         'BP_Component'                               => 'core',
</span><span class="cx" style="display: block; padding: 0 10px">                        'BP_Customizer_Control_Range'                => 'core',
</span><span class="cx" style="display: block; padding: 0 10px">                        'BP_Date_Query'                              => 'core',
</span></span></pre>
</div>
</div>

</body>
</html>