Properties

$version

$version : mixed

Variable to hold the version number.

Type

mixed — Version.

$page

$page : mixed

Variable to hold the Page value.

Type

mixed — Page value, default null.

$subPages

$subPages : mixed

Variable to hold the Sub Pages.

Type

mixed — Sub Page, default null.

$instance

$instance : mixed

Static variable to hold the single instance of the class.

Type

mixed — Default null

Methods

__construct()

__construct() 

Constructor

Runs each time the class is called.

init()

init() 

Initiate Hooks

Initiates hooks for the Subscription extension.

admin_init()

admin_init() 

Admin Init

Initiates admin hooks.

hook_log_specific_actions()

hook_log_specific_actions(array  $logs_spec) : array

Hook hook_log_specific_actions.

Parameters

array $logs_spec

Log actions.

Returns

array —

$logs_spec Log actions.

hook_init_primary_menu_items()

hook_init_primary_menu_items(array  $items, string  $which_menu) : array

Init sub menu logs settings.

Parameters

array $items

Sub menu items.

string $which_menu

first|second.

Returns

array —

$tmp_items Menu items.

hook_get_default_cost_fields()

hook_get_default_cost_fields(string  $def_val = null, string  $field = 'all') : array

Method hook_get_default_cost_fields().

Parameters

string $def_val

Default value.

string $field

Field name.

Returns

array —

Default fields values.

get_default_fields_values()

get_default_fields_values(string  $field = 'all') : array

Method get_default_fields_values().

Parameters

string $field

Field name.

Returns

array —

Default fields values.

init_menu()

init_menu() 

Method init_menu()

Add Insights Overview sub menu "Insights".

init_left_menu()

init_left_menu(array  $subPages) 

Initiates Cost Tracker menu.

Parameters

array $subPages

Cost Tracker sub pages.

render_header()

render_header(string  $shownPage = '') 

Method render_header()

Render page header.

Parameters

string $shownPage

Current Page.

handle_edit_cost_tracker_post()

handle_edit_cost_tracker_post() : mixed

Edit subscription Post

Handles the saving subscription.

Returns

mixed —

Save output.

handle_settings_post()

handle_settings_post() : mixed

Settigns Post

Handles the save settings post request.

Returns

mixed —

Save output.

validate_custom_settings_text_fields()

validate_custom_settings_text_fields(array  $arr) : array

Method array_validate_text_fields().

Parameters

array $arr

Data to valid.

Returns

array —

Validated array fields data.

hook_get_next_renewal()

hook_get_next_renewal(mixed  $filter_input, integer  $previous_renewal, string  $renewal_type) 

Method hook_get_next_renewal().

Get the next renewal.

Parameters

mixed $filter_input

filter input value.

integer $previous_renewal

last renewal.

string $renewal_type

renewal time.

get_next_renewal()

get_next_renewal(integer  $previous_renewal, string  $renewal_type) 

Method get_next_renewal().

Get the next renewal.

Parameters

integer $previous_renewal

last renewal.

string $renewal_type

renewal time.

get_product_types()

get_product_types() 

Method get_product_types().

get_payment_methods()

get_payment_methods() 

Method get_payment_methods().

get_renewal_frequency()

get_renewal_frequency() 

Method get_renewal_frequency().

get_cost_status()

get_cost_status() 

Method get_cost_status().

handle_sites_screen_settings()

handle_sites_screen_settings() 

Method handle_sites_screen_settings()

Handle sites screen settings

mainwp_help_content()

mainwp_help_content() 

Hooks the section help content to the Help Sidebar element.

generate_next_renewal()

generate_next_renewal(object  $subscription) : void

Method generate_next_renewal()

Generate next renewal info.

Parameters

object $subscription

subscription.

get_cost_status_label()

get_cost_status_label(mixed  $key = false) : string

Returns the label for a cost status.

Parameters

mixed $key

false|string to get status of key.

Returns

string