Changeset 12994 for trunk/src/bp-core/classes/class-bp-component.php
- Timestamp:
- 07/12/2021 07:48:13 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/classes/class-bp-component.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-component.php
r12581 r12994 918 918 * @since 6.0.0 919 919 * 920 * @see `BP_Block->construct()` for a full description of a BP Block arguments. 921 * 920 922 * @param array $blocks The list of BP Blocks to register. 921 923 */ 922 924 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 ); 934 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 ); 936 937 if ( $blocks ) { 935 938 foreach ( $blocks as $block ) { 936 939 bp_register_block( $block );
Note: See TracChangeset
for help on using the changeset viewer.