Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filters and actions for whoop theme compatibility #15

Merged
merged 3 commits into from
Sep 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion change_log.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
v0.0.9
Changed textdomain from defined constant to a string - CHANGED
Added filters and actions for whoop theme compatibility - ADDED
Notification not showing properly - FIXED

v0.0.8
Option added to enable/disable activity component - ADDED
Option added to enable/disable notifications component - ADDED
Added placeholder text to message textarea - ADDED
Compliments in activity dropdown filter is ambiguous - FIXED
Undefined property ID notice - FIXED
Changed textdomain from defined constant to a string - CHANGED

v0.0.7
Compliments can be renamed to anything Ex: "Gifts" - ADDED
Expand Down
5 changes: 4 additions & 1 deletion includes/bp-compliments-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ function bp_compliments_format_notifications( $action, $item_id, $secondary_item
*/
return apply_filters( 'bp_compliments_new_compliment_notification', '<a href="' . $link . '">' . $text . '</a>', $total_items, $link, $text, $item_id, $secondary_item_id );
} else {
return false;
return apply_filters( 'bp_compliments_new_toolbar_compliment_notification', array(
'link' => $link,
'text' => $text
), (int) $total_items, $item_id );
}
}

Expand Down
8 changes: 5 additions & 3 deletions includes/templates/buddypress/members/single/compliments.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ class='preview-upload'/>
<div class="comp-user-avatar">
<?php
$user = get_user_by('id', $author_id);
$name = $user->display_name;
$user_link = bp_core_get_user_domain($author_id);
$name = apply_filters('bp_compliments_item_user_name', $user->display_name, $user);
$user_link = apply_filters('bp_compliments_item_user_link', bp_core_get_user_domain($author_id), $author_id);
$avatar_size = apply_filters('bp_compliments_item_user_avatar_size', 60);
?>
<?php echo get_avatar($author_id, 60); ?>
<?php echo get_avatar($author_id, $avatar_size); ?>
<div class="comp-username">
<a href="<?php echo $user_link; ?>" class="url"><?php echo $name; ?></a>
<?php do_action('bp_compliments_after_user_name', $author_id); ?>
</div>
</div>
</div>
Expand Down