Changeset 12994
- Timestamp:
- 07/12/2021 07:48:13 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r12670 r12994 380 380 parent::rest_api_init( $controllers ); 381 381 } 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 } 382 394 } -
trunk/src/bp-core/classes/class-bp-block.php
r12661 r12994 48 48 * @since 6.0.0 49 49 * 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 * } 51 73 */ 52 74 public function __construct( $args ) { -
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 ); -
trunk/src/bp-core/classes/class-bp-core.php
r12753 r12994 352 352 parent::register_post_types(); 353 353 } 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 } 354 382 } -
trunk/src/bp-friends/classes/class-bp-friends-component.php
r12670 r12994 338 338 parent::rest_api_init( array( 'BP_REST_Friends_Endpoint' ) ); 339 339 } 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 } 340 352 } -
trunk/src/bp-members/classes/class-bp-members-component.php
r12951 r12994 696 696 * @since 5.0.0 697 697 * @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. 698 699 * 699 700 * @param array $controllers Optional. See BP_Component::rest_api_init() for … … 702 703 public function rest_api_init( $controllers = array() ) { 703 704 $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',709 705 'BP_REST_Members_Endpoint', 710 706 'BP_REST_Attachments_Member_Avatar_Endpoint', -
trunk/src/bp-messages/classes/class-bp-messages-component.php
r12463 r12994 446 446 parent::rest_api_init( array( 'BP_REST_Messages_Endpoint' ) ); 447 447 } 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 } 448 460 } -
trunk/src/bp-settings/classes/class-bp-settings-component.php
r12745 r12994 293 293 parent::setup_admin_bar( $wp_admin_nav ); 294 294 } 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 } 295 307 } -
trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php
r12869 r12994 457 457 ) ); 458 458 } 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 } 459 471 } -
trunk/tests/phpunit/testcases/core/class-bp-component.php
r12607 r12994 31 31 32 32 $this->assertSame( $bp->unit_test_rest->controllers, array( 33 'BP_REST_Components_Endpoint',34 33 'BP_REST_Members_Endpoint', 35 34 'BP_REST_Attachments_Member_Avatar_Endpoint', … … 49 48 50 49 $this->assertSame( $bp->unit_test_rest->controllers, array( 51 'BP_REST_Components_Endpoint',52 50 'BP_REST_Attachments_Member_Avatar_Endpoint', 53 51 'BP_REST_Attachments_Member_Cover_Endpoint', … … 66 64 67 65 $this->assertSame( $bp->unit_test_rest->controllers, array( 68 'BP_REST_Components_Endpoint',69 66 'BP_REST_Members_Endpoint', 70 67 'BP_REST_Attachments_Member_Avatar_Endpoint',
Note: See TracChangeset
for help on using the changeset viewer.