PHP Class RCP_Member, restrict-content-pro

Since: 2.1
Inheritance: extends WP_User
Show file Open project: restrictcontentpro/restrict-content-pro Class Usage Examples

Public Methods

Method Description
add_note ( $note = '' ) Adds a new note to a member
calculate_expiration ( $force_now = false ) : String Calculates the new expiration date for a member
can_access ( $post_id ) Determines if the member can access current content
cancel ( ) Sets a member's membership as cancelled by updating status
get_card_details ( ) : string Get details about the member's card on file
get_expiration_date ( $formatted = true, $pending = true ) Retrieves the expiration date of the member
get_expiration_time ( ) Retrieves the expiration date of the member as a timestamp
get_joined_date ( $subscription_id ) : string Retrieves the joined date for a subscription
get_merchant_subscription_id ( ) Retrieves the subscription ID of the member from the merchant processor.
get_notes ( ) Retrieves the notes on a member
get_payment_profile_id ( ) Retrieves the profile ID of the member.
get_payments ( ) Retrieves all payments belonging to the member
get_pending_subscription_id ( ) Retrieves the pending subscription ID of the member
get_pending_subscription_key ( ) Retrieves the pending subscription key of the member
get_pending_subscription_name ( ) Retrieves the pending subscription name of the member
get_prorate_credit_amount ( ) : integer Get the prorate credit amount for the user's remaining subscription
get_renewed_date ( $subscription_id ) : string Retrieves the renewed date for a subscription
get_status ( ) Retrieves the status of the member
get_subscription_id ( ) Retrieves the subscription ID of the member
get_subscription_key ( ) Retrieves the subscription key of the member
get_subscription_name ( ) Retrieves the current subscription name of the member
get_switch_to_url ( ) Gets the URL to switch to the user if the User Switching plugin is active
has_trialed ( ) Determines if the member has used a trial
is_active ( ) Determines if a member has an active subscription, or is cancelled but has not reached EOT
is_expired ( ) Determines if the member is expired
is_recurring ( ) Determines if a member has a recurring subscription
is_trialing ( ) Determines if the member is currently trailing
just_upgraded ( ) : integer Determines if the customer just upgraded
renew ( $recurring = false, $status = 'active', $expiration = '' ) Renews a member's membership by updating status and expiration date
set_expiration_date ( $new_date = '' ) Sets the expiration date for a member
set_joined_date ( $date = '', $subscription_id ) Sets the joined date for a member
set_merchant_subscription_id ( $subscription_id = '' ) Sets the payment profile ID for a member
set_payment_profile_id ( $profile_id = '' ) Sets the payment profile ID for a member
set_recurring ( $yes = true ) Sets whether a member is recurring
set_renewed_date ( $date = '' ) Sets the renewed date for a member
set_status ( $new_status = '' ) Sets the status of a member

Method Details

add_note() public method

Adds a new note to a member
Since: 2.1
public add_note ( $note = '' )

calculate_expiration() public method

Calculates the new expiration date for a member
Since: 2.4
public calculate_expiration ( $force_now = false ) : String
return String Date in Y-m-d H:i:s format or "none" if is a lifetime member

can_access() public method

Determines if the member can access current content
Since: 2.1
public can_access ( $post_id )

cancel() public method

Does NOT handle actual cancellation of subscription payments, that is done in rcp_process_member_cancellation(). This should be called after a member is successfully cancelled.
Since: 2.1
public cancel ( )

get_card_details() public method

Get details about the member's card on file
Since: 2.5
public get_card_details ( ) : string
return string

get_expiration_date() public method

Retrieves the expiration date of the member
Since: 2.1
public get_expiration_date ( $formatted = true, $pending = true )

get_expiration_time() public method

Retrieves the expiration date of the member as a timestamp
Since: 2.1
public get_expiration_time ( )

get_joined_date() public method

Retrieves the joined date for a subscription
Since: 2.6
public get_joined_date ( $subscription_id ) : string
return string Joined date

get_merchant_subscription_id() public method

This is used by payment gateways to retrieve the ID of the subscription.
Since: 2.5

get_notes() public method

Retrieves the notes on a member
Since: 2.1
public get_notes ( )

get_payment_profile_id() public method

This is used by payment gateways to store customer IDs and other identifiers for payment profiles
Since: 2.1

get_payments() public method

Retrieves all payments belonging to the member
Since: 2.1
public get_payments ( )

get_pending_subscription_id() public method

Retrieves the pending subscription ID of the member
Since: 2.4.12

get_pending_subscription_key() public method

Retrieves the pending subscription key of the member
Since: 2.4.12

get_pending_subscription_name() public method

Retrieves the pending subscription name of the member
Since: 2.4.12

get_prorate_credit_amount() public method

Get the prorate credit amount for the user's remaining subscription
Since: 2.5

get_renewed_date() public method

Retrieves the renewed date for a subscription
Since: 2.6
public get_renewed_date ( $subscription_id ) : string
return string Renewed date

get_status() public method

Retrieves the status of the member
Since: 2.1
public get_status ( )

get_subscription_id() public method

Retrieves the subscription ID of the member
Since: 2.1
public get_subscription_id ( )

get_subscription_key() public method

Retrieves the subscription key of the member
Since: 2.1

get_subscription_name() public method

Retrieves the current subscription name of the member
Since: 2.1

get_switch_to_url() public method

Gets the URL to switch to the user if the User Switching plugin is active
Since: 2.1
public get_switch_to_url ( )

has_trialed() public method

Determines if the member has used a trial
Since: 2.1
public has_trialed ( )

is_active() public method

Determines if a member has an active subscription, or is cancelled but has not reached EOT
Since: 2.1
public is_active ( )

is_expired() public method

Determines if the member is expired
Since: 2.1
public is_expired ( )

is_recurring() public method

Determines if a member has a recurring subscription
Since: 2.1
public is_recurring ( )

is_trialing() public method

Determines if the member is currently trailing
Since: 2.1
public is_trialing ( )

just_upgraded() public method

Determines if the customer just upgraded
Since: 2.5
public just_upgraded ( ) : integer
return integer - Timestamp reflecting the date/time of the latest upgrade

renew() public method

Does NOT handle payment processing for the renewal. This should be called after receiving a renewal payment
Since: 2.1
public renew ( $recurring = false, $status = 'active', $expiration = '' )

set_expiration_date() public method

Should be passed as a MYSQL date string.
Since: 2.1
public set_expiration_date ( $new_date = '' )

set_joined_date() public method

Sets the joined date for a member
Since: 2.6
public set_joined_date ( $date = '', $subscription_id )

set_merchant_subscription_id() public method

This is used by payment gateways to store the ID of the subscription.
Since: 2.5
public set_merchant_subscription_id ( $subscription_id = '' )

set_payment_profile_id() public method

This is used by payment gateways to store customer IDs and other identifiers for payment profiles
Since: 2.1
public set_payment_profile_id ( $profile_id = '' )

set_recurring() public method

Sets whether a member is recurring
Since: 2.1
public set_recurring ( $yes = true )

set_renewed_date() public method

Sets the renewed date for a member
Since: 2.6
public set_renewed_date ( $date = '' )

set_status() public method

Sets the status of a member
Since: 2.1
public set_status ( $new_status = '' )