Skip to:
Content

BuddyPress.org

Changeset 3400


Ignore:
Timestamp:
11/12/2010 03:00:07 PM (14 years ago)
Author:
boonebgorges
Message:

Adds bp_activity_can_favorite() to allow plugin authors to filter favoritability of activity items. Fixes #2078

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-templatetags.php

    r3373 r3400  
    911911}
    912912
     913function bp_activity_can_favorite() {   
     914    $can_favorite = true;
     915   
     916    return apply_filters( 'bp_activity_can_favorite', $can_favorite );
     917}
     918
    913919function bp_total_favorite_count_for_user( $user_id = false ) {
    914920    echo bp_get_total_favorite_count_for_user( $user_id );
  • trunk/bp-themes/bp-default/activity/entry.php

    r3300 r3400  
    2929            <?php endif; ?>
    3030
    31             <?php if ( is_user_logged_in() ) : ?>
     31            <?php if ( is_user_logged_in() && bp_activity_can_favorite() ) : ?>
    3232                <?php if ( !bp_get_activity_is_favorite() ) : ?>
    3333                    <a href="<?php bp_activity_favorite_link() ?>" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
Note: See TracChangeset for help on using the changeset viewer.