Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/11/2019 01:33:14 PM (5 years ago)
Author:
imath
Message:

Improve i18n of Groups activity updates action string

Dynamically generated activity action strings were introduced in BuddyPress 2.0 to ensure these strings are always up to date and multilingual-friendly (see #3856).

It appeared although the activity_update type enjoys this feature when activities are shared by users on their profiles, it was not the case for activity updates posted within Groups.

Thanks to this commit, BuddyPress is now taking it in charge by:

  • Registering a new group activity action to reference a specific formatting callback function for activities posted within Groups.
  • Making sure this new activity action type does not interfere with the one of regular activity updates in dropdown filters or into the Activity Administration screens.

BTW happy 4th WPTranslationDay to everyone :)

Fixes #8089

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-list-table.php

    r12331 r12395  
    436436                    }
    437437
     438                    // The 'activity_update' filter is already used by the Activity component.
     439                    if ( isset( $actions->activity_update ) && 'bp_groups_format_activity_action_group_activity_update' === $actions->activity_update['format_callback'] ) {
     440                        unset( $actions->activity_update );
     441                    }
     442
    438443                    if ( bp_is_active( $component ) ) {
    439444                        if ( $component === 'xprofile' ) {
     
    456461
    457462                            // Skip the incorrectly named pre-1.6 action.
    458                             if ( 'friends_register_activity_action' !== $action_key ) : ?>
     463                            if ( 'friends_register_activity_action' !== $action_key  ) : ?>
    459464
    460465                                <option value="<?php echo esc_attr( $action_key ); ?>" <?php selected( $action_key,  $selected ); ?>><?php echo esc_html( $action_values[ 'value' ] ); ?></option>
Note: See TracChangeset for help on using the changeset viewer.