Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/14/2021 08:29:34 PM (4 years ago)
Author:
imath
Message:

Merge the BP Blocks plugin's 'bp/sitewide-notices' Block

  • Add a front-end script to the Messages component to manage dismissible notices displayed into the Widget Block.
  • Adapt Grunt sass tasks.
  • Add the Block JavaScript source files into src/js/bp-messages/js/blocks.
  • Add the Block Scss source file into src/bp-messages/sass.
  • Generate the development files to ease testing.

Props dcavins

Fixes #8525

File:
1 edited

Legend:

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

    r12994 r13005  
    6363            'functions',
    6464            'widgets',
     65            'blocks',
    6566        );
    6667
     
    456457     */
    457458    public function blocks_init( $blocks = array() ) {
    458         parent::blocks_init( array() );
     459        parent::blocks_init(
     460            array(
     461                'bp/sitewide-notices' => array(
     462                    'name'               => 'bp/sitewide-notices',
     463                    'editor_script'      => 'bp-sitewide-notices-block',
     464                    'editor_script_url'  => plugins_url( 'js/blocks/sitewide-notices.js', dirname( __FILE__ ) ),
     465                    'editor_script_deps' => array(
     466                        'wp-blocks',
     467                        'wp-element',
     468                        'wp-components',
     469                        'wp-i18n',
     470                        'wp-block-editor',
     471                        'bp-block-data',
     472                        'bp-block-components',
     473                    ),
     474                    'style'              => 'bp-sitewide-notices-block',
     475                    'style_url'          => plugins_url( 'css/blocks/sitewide-notices.css', dirname( __FILE__ ) ),
     476                    'attributes'         => array(
     477                        'title' => array(
     478                            'type'    => 'string',
     479                            'default' => '',
     480                        ),
     481                    ),
     482                    'render_callback'    => 'bp_messages_render_sitewide_notices_block',
     483                ),
     484            )
     485        );
    459486    }
    460487}
Note: See TracChangeset for help on using the changeset viewer.