Changeset 13006 for trunk/src/bp-blogs/classes/class-bp-blogs-component.php
- Timestamp:
- 07/14/2021 09:19:32 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r12994 r13006 82 82 'global_tables' => $global_tables, 83 83 'meta_tables' => $meta_tables, 84 'block_globals' => array( 85 'bp/recent-posts' => array( 86 'widget_classnames' => array( 'widget_bp_blogs_widget', 'buddypress' ), 87 ), 88 ), 84 89 ); 85 90 … … 137 142 if ( is_multisite() ) { 138 143 $includes[] = 'widgets'; 144 $includes[] = 'blocks'; 139 145 } 140 146 … … 390 396 */ 391 397 public function blocks_init( $blocks = array() ) { 392 parent::blocks_init( array() ); 398 $blocks = array(); 399 400 if ( is_multisite() ) { 401 $blocks['bp/recent-posts'] = array( 402 'name' => 'bp/recent-posts', 403 'editor_script' => 'bp-recent-posts-block', 404 'editor_script_url' => plugins_url( 'js/blocks/recent-posts.js', dirname( __FILE__ ) ), 405 'editor_script_deps' => array( 406 'wp-blocks', 407 'wp-element', 408 'wp-components', 409 'wp-i18n', 410 'wp-block-editor', 411 'bp-block-components', 412 ), 413 'style' => 'bp-recent-posts-block', 414 'style_url' => plugins_url( 'css/blocks/recent-posts.css', dirname( __FILE__ ) ), 415 'attributes' => array( 416 'title' => array( 417 'type' => 'string', 418 'default' => __( 'Recent Networkwide Posts', 'buddypress' ), 419 ), 420 'maxPosts' => array( 421 'type' => 'number', 422 'default' => 10, 423 ), 424 'linkTitle' => array( 425 'type' => 'boolean', 426 'default' => false, 427 ), 428 ), 429 'render_callback' => 'bp_blogs_render_recent_posts_block', 430 ); 431 } 432 433 parent::blocks_init( $blocks ); 393 434 } 394 435 }
Note: See TracChangeset
for help on using the changeset viewer.