M_ping_leftsub

The Membership 2 M ping leftsub function.

Description

M_ping_leftsub( $fromsub_id, $fromlevel_id, $user_id ); 

Parameters (3)

0. $fromsub_id
The fromsub id.
1. $fromlevel_id
The fromlevel id.
2. $user_id
The user id.

Usage

  1. if ( !function_exists( 'M_ping_leftsub' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app_old/membershipincludes/classes/class.ping.php'; 
  3.  
  4. // The fromsub id. 
  5. $fromsub_id = null; 
  6.  
  7. // The fromlevel id. 
  8. $fromlevel_id = null; 
  9.  
  10. // The user id. 
  11. $user_id = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = M_ping_leftsub($fromsub_id, $fromlevel_id, $user_id); 
  15.  

Defined (1)

The function is defined in the following location(s).

/app_old/membershipincludes/classes/class.ping.php  
  1. function M_ping_leftsub( $fromsub_id, $fromlevel_id, $user_id ) { 
  2.  
  3. // Leaving the level 
  4. M_ping_leftlevel( $fromlevel_id, $user_id ); 
  5.  
  6. // Leaving the sub 
  7. $sub = new M_Subscription( $fromsub_id ); 
  8. $subleavingping_id = $sub->get_meta( 'leaving_ping' ); 
  9.  
  10. if(!empty($subleavingping_id)) { 
  11. $ping = new M_Ping( $subleavingping_id ); 
  12.  
  13. $ping->send_ping( $fromsub_id, false, $user_id ); 
  14.