Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/12/2021 11:57:59 PM (5 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-groups/bp-groups-blocks.php

    r12791 r12996  
    1212        exit;
    1313}
    14 
    15 /**
    16  * Add BP Groups 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 Groups blocks editor settings.
    22  */
    23 function bp_groups_editor_settings( $bp_editor_settings = array() ) {
    24         $bp = buddypress();
    25 
    26         return array_merge(
    27                 $bp_editor_settings,
    28                 array(
    29                         'groups' => array(
    30                                 'isAvatarEnabled'     => $bp->avatar && $bp->avatar->show_avatars && ! bp_disable_group_avatar_uploads(),
    31                                 'isCoverImageEnabled' => bp_is_active( 'groups', 'cover_image' ),
    32                         ),
    33                 )
    34         );
    35 }
    36 add_filter( 'bp_blocks_editor_settings', 'bp_groups_editor_settings' );
    3714
    3815/**
    … …  
    265242                                '<div class="item-header-avatar">
    266243                                        <a href="%1$s">
    267                                                 <img class="avatar" alt="%2$s" src="%3$s" />
     244                                                <img loading="lazy" src="%2$s" alt="%3$s" class="avatar">
    268245                                        </a>
    269246                                </div>',
    270247                                esc_url( $group_link ),
    271248                                /* Translators: %s is the group's name. */
    272                                 sprintf( esc_attr__( 'Group Profile photo of %s', 'buddypress' ), $group->display_name ),
     249                                sprintf( esc_attr__( 'Group Profile photo of %s', 'buddypress' ), esc_html( $group->name ) ),
    273250                                esc_url(
    274251                                        bp_core_fetch_avatar(
Note: See TracChangeset for help on using the changeset viewer.