_active_profiles = $profiles; }//end __construct method public static function init( $profiles ){ if(!self::$_instance instanceof self ){ self::$_instance = new Athena_Post_Delete( $profiles ); } return self::$_instance; }//end init method public function pre_delete_action( $post_id ){ global $post_type; if($post_type === 'athenaprofile'){ if(wp_next_scheduled( 'athena_profile_ex_' . $post_id, array($post_id) ) !== false){ wp_clear_scheduled_hook( 'athena_profile_ex_' . $post_id , array($post_id) ); } if(wp_next_scheduled('athena_profile_email_' . $post_id, array($post_id) ) !== false){ wp_clear_scheduled_hook( 'athena_profile_email_' . $post_id , array($post_id) ); } delete_option('athena_profile_'.$post_id); if(is_array($this->_active_profiles) && ($key = in_athena_array($this->_active_profiles, $post_id)) !== false){ unset($this->_active_profiles[$key]); update_option('athena_active_profiles', $this->_active_profiles, true); } } }//end pre_delete_action method }//end Athena_Post_Delete class }//end class_exists