Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding buddypress filter and hook to membership pro function


  • gurusurfer
    Participant

    @gurusurfer

    Hi,

    Here is a function for the membership 2 pro which outputs the member subscription type:

    if ( function_exists('bp_displayed_user_id') && class_exists('Membership_Plugin') && class_exists('Membership_Model_Subscription') ) {
    	$user_id = bp_displayed_user_id();
    	$user = Membership_Plugin->factory()->get_member($user_id);
    	$subs = $user->get_subscription_ids();
    
    	if ( is_array($subs) ) {
    		$sub = array_pop($subs);
    		$subscription = new Membership_Model_Subscription($sub));
    		echo $subscription->sub_name();
    	}
    }

    Now what filter I need to add to it, and hook to called as i need to display the output on members profiles.

    Help is much appreciated!

    Thanks

  • The topic ‘Adding buddypress filter and hook to membership pro function’ is closed to new replies.
Skip to toolbar