Plugin Directory

Changeset 1447909


Ignore:
Timestamp:
07/02/2016 10:51:20 PM (10 years ago)
Author:
kcbluewave890
Message:

Added actions after user is followed and unfollowed.

Location:
bbp-follow-users/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bbp-follow-users/trunk/includes/actions.php

    r1437955 r1447909  
    3434
    3535add_action('wp_ajax_bbpresslist_process_follow', 'bbpresslist_process_follow');
    36 add_action('wp_ajax_bbpresslist_process_follow', 'bbpresslist_process_follow');
     36
    3737
    3838/**
     
    5757
    5858add_action('wp_ajax_bbpresslist_process_unfollow', 'bbpresslist_process_unfollow');
    59 add_action('wp_ajax_bbpresslist_process_unfollow', 'bbpresslist_process_unfollow');
     59
    6060
    6161?>
  • bbp-follow-users/trunk/includes/class-bbpress-list-user.php

    r1437955 r1447909  
    4040  $following = get_user_meta( $user_id, '_bbpresslist_following', true);
    4141
    42     return $following;
     42    return apply_filters('bbp_follow_get_following', $following, $user_id );
    4343
    4444  }
     
    7878
    7979   update_user_meta ( $user_id, '_bbpresslist_following', $users_in_list );
     80   do_action( 'bbp_list_user_added_following', $user_id, $users_in_list );
    8081   update_user_meta ( $follower_id, '_bbpresslist_followers', $followers );
     82   do_action( 'bbp_list_user_added_followers', $follower_id, $followers );
    8183
    8284   return 'follow';
     
    127129        if ( $modified ) {
    128130            update_user_meta( $unfollow_user, '_bbpresslist_followers', $followers );
     131        do_action( 'bbp_list_user_unfollow', $unfollow_user, $followers );
    129132        }
    130133    }
  • bbp-follow-users/trunk/js/follow.js

    r1437955 r1447909  
    2525
    2626            success: function(results) {
     27
    2728                if (results == 'follow') {
    2829                    $('.follow-link .follow').attr('class', 'unfollow').text('Unfollow this user');
    2930                } else {
    3031                    $('.follow-link .unfollow').attr('class', 'follow').text('Follow this user');
    31                 }
     32                } 
    3233            }
    3334        });
  • bbp-follow-users/trunk/readme.txt

    r1437979 r1447909  
    44Requires at least: WP 3.5 / bbPress
    55Tested up to: WP 4.4.x
    6 Stable tag: 1.0
     6Stable tag: 1.1
    77
    88== Description ==
    99
    10 This simple plugin allows users to follow other members on bbPress. The users can view the latest posts and replies from their followed users in a widget that can be placed anywhere on the site.
     10This simple plugin allows users to follow other members on bbPress . The users can view the latest posts and replies from their followed users in a widget that can be placed anywhere on the site.
    1111
    1212This plugin adds:
     
    3232== Changelog ==
    3333
     34= 1.1 =
     35* Add action after user is followed.
     36* Add action after user is unfollowed.
     37
    3438
    3539= 1.0 =
Note: See TracChangeset for help on using the changeset viewer.