Plugin Directory

Changeset 1380129


Ignore:
Timestamp:
03/28/2016 07:42:50 AM (10 years ago)
Author:
quan_flo
Message:

added new filter to exclude special users from being tracked

Location:
buddypress-who-clicked-at-my-profile/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • buddypress-who-clicked-at-my-profile/trunk/buddypress-who-clicked-at-my-profile.php

    r1377937 r1380129  
    3737    $current_user = wp_get_current_user();
    3838    $displayed_user_id = $bp->displayed_user->id;
    39     $viewing_user_id = $current_user->ID;
    40     if (($displayed_user_id != $viewing_user_id) && ($viewing_user_id > 0)) {
     39    $excludeUsers = apply_filters('buddypress_wcamp_excludeUsers', array());
     40    if (($displayed_user_id != $viewing_user_id) && ($viewing_user_id > 0) && (!in_array($current_user->ID, $excludeUsers))) {
    4141
    4242        // get user meta data (clickedme_tracking is a serialized array containing the last visits)
     
    6060            }
    6161            // remove double clicks
    62             if ($viewing_user_id != $trackingListItem['user_id']) {
     62            if (($viewing_user_id != $trackingListItem['user_id']) && (!in_array($trackingListItem['user_id'], $excludeUsers))) {
    6363                $newTrackingList[] = $trackingListItem;
    6464            } else if ($useBuddypressNotifications) {
  • buddypress-who-clicked-at-my-profile/trunk/readme.txt

    r1377922 r1380129  
    5757This sets the value of users that get tracked to 25 for example.
    5858
     59
     60= Exclude some users from being tracked? =
     61
     62Some users should not be tracked? No problem!
     63
     64Add the following code to your functions.php
     65
     66`add_filter('buddypress_wcamp_excludeUsers','my_buddypress_wcamp_excludeUsers');
     67function my_buddypress_wcamp_excludeUsers() {
     68    return array(1,5,8,23); // exclude (as example) Users with ID 1, 5, 8 and 23
     69}`
     70
     71This sets the value of users that get tracked to 25 for example.
     72
    5973= You do not want to use the buddypress notification system for "who clicked at my profile" notifications? =
    6074
     
    7589
    7690== Changelog ==
     91
     92= 3.4 =
     93* Added filter for excluding specified users from being tracked, see FAQ for usage
    7794
    7895= 3.3 =
Note: See TracChangeset for help on using the changeset viewer.