Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'bp_activity_entry_meta'

Viewing 2 results - 26 through 27 (of 27 total)
  • Author
    Search Results
  • #65001
    ousep
    Participant

    @snark: I’ve modified the function to this:

    function my_favorite_count() {
    $my_fav_count = bp_activity_get_meta( bp_get_activity_id(), 'favorite_count' );
    if ($my_fav_count >= 1) : {
    if (is_user_logged_in()) : {
    echo '<span>(' . $my_fav_count . ')</span>';
    }
    endif;
    }
    endif;
    }
    add_action( 'bp_activity_entry_meta', 'my_favorite_count' );

    Apart from shortening my function name, this shows the count only if the visitor is logged in.

    This code goes into bp-custom.php, and it outputs the count next to the Favorite or Remove Favorite button.

    #9006
    ousep
    Participant

    I’ve put this into my bp-custom.php:

    function my_show_favorite_count() {
    $my_fav_count = bp_activity_get_meta( $_POST['id'], 'favorite_count' );
    echo $my_fav_count;
    }
    add_action( 'bp_activity_entry_meta', 'my_show_favorite_count' );

    to get the total number of times an activity has been favourited…

    But, nothing shows up… Am I missing something here?

Viewing 2 results - 26 through 27 (of 27 total)
Skip to toolbar