Skip to content

Commit

Permalink
Toolbar activity items should have a single clickable link.
Browse files Browse the repository at this point in the history
  • Loading branch information
boonebgorges committed Jun 26, 2024
1 parent 0c0fd26 commit 8741b85
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions includes/network-toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1086,43 +1086,27 @@ public function add_activity_menu( $wp_admin_bar ) {
while ( bp_activities() ) {
bp_the_activity();

// avatar
$title = sprintf(
'<div class="row activity-row"><div class="col-sm-6"><div class="item-avatar"><a href="%s"><img class="img-responsive" src="%s" alt="%s" /></a></div></div>',
bp_get_activity_user_link(),
bp_core_fetch_avatar(
array(
'item_id' => bp_get_activity_user_id(),
'object' => 'member',
'type' => 'full',
'html' => false,
)
),
sprintf(
// translators: user name
__( 'Profile picture of %s', 'commons-in-a-box' ),
bp_core_get_user_displayname( bp_get_activity_user_id() )
$avatar_url = bp_core_fetch_avatar(
array(
'item_id' => bp_get_activity_user_id(),
'object' => 'member',
'type' => 'full',
'html' => false,
)
);

$avatar_alt_text = sprintf(
__( 'Profile picture of %s', 'commons-in-a-box' ),

Check failure on line 1099 in includes/network-toolbar.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.
bp_core_get_user_displayname( bp_get_activity_user_id() )
);

// avatar
$title = '<div class="ol-toolbar-row activity-row"><div class="col-sm-6"><div class="item-avatar"><img class="img-responsive" src="' . esc_url( $avatar_url ) . '" alt="' . esc_attr( $avatar_alt_text ) . '"/></div></div>';

// action
$title .= '<div class="col-sm-18">';

//the things we do...
$action_output = '';
$action_output_raw = $activities_template->activity->action;
$action_output_ary = explode( '<a', $action_output_raw );
$count = 0;

foreach ( $action_output_ary as $action_redraw ) {
if ( ! ctype_space( $action_redraw ) ) {
$class = 0 === $count ? 'activity-user' : 'activity-action';
$action_output .= '<a class="' . $class . '"' . $action_redraw;
$count++;
}
}

$title .= '<p class="item inline-links hyphenate">' . $action_output . '</p>';
$title .= '<p class="item inline-links hyphenate">' . wp_strip_all_tags( $activities_template->activity->action ) . '</p>';
$title .= '<p class="item">' . bp_insert_activity_meta( '' ) . '</p>';
$title .= '</div></div>';

Expand Down

0 comments on commit 8741b85

Please sign in to comment.