Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/12/2021 11:57:59 PM (3 years ago)
Author:
imath
Message:

Edit existing Blocks to use the newly introduced Component and Assets

  • Stop filtering bp_blocks_editor_settings to transport Activity embed, Member/s and Group/s blocks.
  • Edit JavaScript files to use the new ServerSideRender BP Block Component and the BP Block Assets.
  • Use bright red icons for all BP Blocks.
  • Update JavaScript BP Blocks dependencies.

Fixes #8513

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-blocks.php

    r12791 r12996  
    1212    exit;
    1313}
    14 
    15 /**
    16  * Add BP Members blocks specific settings to the BP Blocks Editor ones.
    17  *
    18  * @since 6.0.0
    19  *
    20  * @param array $bp_editor_settings BP blocks editor settings.
    21  * @return array BP Members blocks editor settings.
    22  */
    23 function bp_members_editor_settings( $bp_editor_settings = array() ) {
    24     $bp = buddypress();
    25 
    26     return array_merge(
    27         $bp_editor_settings,
    28         array(
    29             'members' => array(
    30                 'isMentionEnabled'    => bp_is_active( 'activity' ) && bp_activity_do_mentions(),
    31                 'isAvatarEnabled'     => $bp->avatar && $bp->avatar->show_avatars,
    32                 'isCoverImageEnabled' => bp_is_active( 'members', 'cover_image' ),
    33             ),
    34         )
    35     );
    36 }
    37 add_filter( 'bp_blocks_editor_settings', 'bp_members_editor_settings' );
    3814
    3915/**
     
    261237                '<div class="item-header-avatar">
    262238                    <a href="%1$s">
    263                         <img class="avatar" alt="%2$s" src="%3$s" />
     239                        <img loading="lazy" class="avatar" alt="%2$s" src="%3$s" />
    264240                    </a>
    265241                </div>',
Note: See TracChangeset for help on using the changeset viewer.