LLMS_Notification_Controller_Purchase_Receipt::get_subscriber( string $subscriber )

Takes a subscriber type (student, author, etc) and retrieves a User ID


Parameters Parameters

$subscriber

(string) (Required) Subscriber type string.


Top ↑

Return Return

(int|false)


Top ↑

Source Source

File: includes/notifications/controllers/class.llms.notification.controller.purchase.receipt.php

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
protected function get_subscriber( $subscriber ) {
 
    switch ( $subscriber ) {
 
        case 'author':
            $txn   = llms_get_post( $this->post_id );
            $order = $txn->get_order();
            if ( ! $order ) {
                return false;
            }
            $product = $order->get_product();
            if ( ! $product ) {
                return false;
            }
            $uid = $product->get( 'author' );
            break;
 
        case 'student':
            $uid = $this->user_id;
            break;
 
        default:
            $uid = false;
 
    }
 
    return $uid;
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0
3.10.2 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.