Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/28/2024 06:19:59 PM (18 months ago)
Author:
imath
Message:

BP Blocks: make sure default block titles can be translated

Some of the BP Blocks are using a title attribute into their block.json. Unfortunately, block attributes do not seem to be include in the translatable strings of the WP Block Metadata API.

To fix this, all block.json title attributes now default to an empty string & the default title value is handled within the PHP callback to render the block.

For the specific case of the Latest Activities block, this commit also fixes some errors that were preventing it to be able to select the list of Activity types to include into the rendered activities.

See #9074 (trunk)
Closes https://github.com/buddypress/buddypress/pull/223

File:
1 edited

Legend:

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

    r13676 r13716  
    371371        $attributes,
    372372        array(
    373             'title'        => __( 'Groups', 'buddypress' ),
     373            'title'        => '',
    374374            'maxGroups'    => 5,
    375375            'groupDefault' => 'active',
     
    377377        )
    378378    );
     379
     380    if ( ! $block_args['title'] ) {
     381        $block_args['title'] = __( 'Groups', 'buddypress' );
     382    }
    379383
    380384    $classnames         = 'widget_bp_groups_widget buddypress widget';
Note: See TracChangeset for help on using the changeset viewer.