Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/14/2021 06:45:11 PM (5 years ago)
Author:
imath
Message:

Merge the BP Blocks plugin's 'bp/dynamic-groups' Block

  • Adds a new assets/widgets/dynamic-groups.php JavaScript template to our two template packs.
  • Add a front-end script to the Groups component to manage Widget Block sort filters dynamically.
  • Adapt Grunt sass tasks.
  • Add the Block JavaScript source files into src/js/bp-groups/js/blocks.
  • Add the Block Scss source file into src/bp-groups/sass.
  • Generate the development files to ease testing.

Fixes #8523

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/classes/class-bp-groups-component.php

    r12996 r13004  
    262262            'global_tables'         => $global_tables,
    263263            'meta_tables'           => $meta_tables,
     264            'block_globals'         => array(
     265                'bp/dynamic-groups' => array(
     266                    'widget_classnames' => array( 'widget_bp_groups_widget', 'buddypress' ),
     267                ),
     268            ),
    264269        );
    265270
     
    10591064                    'render_callback'    => 'bp_groups_render_groups_block',
    10601065                ),
     1066                'bp/dynamic-groups' => array(
     1067                    'name'               => 'bp/dynamic-groups',
     1068                    'editor_script'      => 'bp-dynamic-groups-block',
     1069                    'editor_script_url'  => plugins_url( 'js/blocks/dynamic-groups.js', dirname( __FILE__ ) ),
     1070                    'editor_script_deps' => array(
     1071                        'wp-blocks',
     1072                        'wp-element',
     1073                        'wp-components',
     1074                        'wp-i18n',
     1075                        'wp-block-editor',
     1076                        'bp-block-components',
     1077                    ),
     1078                    'style'              => 'bp-dynamic-groups-block',
     1079                    'style_url'          => plugins_url( 'css/blocks/dynamic-groups.css', dirname( __FILE__ ) ),
     1080                    'attributes'         => array(
     1081                        'title'        => array(
     1082                            'type'    => 'string',
     1083                            'default' => __( 'Groups', 'buddypress' ),
     1084                        ),
     1085                        'maxGroups'    => array(
     1086                            'type'    => 'number',
     1087                            'default' => 5,
     1088                        ),
     1089                        'groupDefault' => array(
     1090                            'type'    => 'string',
     1091                            'default' => 'active',
     1092                        ),
     1093                        'linkTitle'    => array(
     1094                            'type'    => 'boolean',
     1095                            'default' => false,
     1096                        ),
     1097                    ),
     1098                    'render_callback'    => 'bp_groups_render_dynamic_groups_block',
     1099                ),
    10611100            )
    10621101        );
Note: See TracChangeset for help on using the changeset viewer.