Wholesale_Roles extends WC_Settings_API
Edit role settings screen
Tags
Table of Contents
- $id : string
- Unique ID for settings screen
- $instance_form_fields : array<string|int, mixed>
- Instance form fields.
- $instance_settings : array<string|int, mixed>
- Instance settings.
- $name : string
- Role name if edit
- $plugin_id : string
- Plugin ID
- __construct() : mixed
- Constructor.
- admin_options() : mixed
- Output the shipping settings screen.
- get_instance_form_fields() : array<string|int, mixed>
- Get settings fields for instances of the wholesale role
- get_instance_option() : mixed
- Gets an option from the settings API, using defaults if necessary to prevent undefined notices.
- get_option() : mixed
- Get_option function.
- init() : mixed
- Init handler.
- init_instance_settings() : mixed
- Initialise Settings for instances.
- process_admin_options() : mixed
- Processes and saves wholesale roles
Properties
$id
Unique ID for settings screen
public
string
$id
= 'wholesale_role'
Tags
$instance_form_fields
Instance form fields.
public
array<string|int, mixed>
$instance_form_fields
= []
Tags
$instance_settings
Instance settings.
public
array<string|int, mixed>
$instance_settings
= []
Tags
$name
Role name if edit
public
string
$name
= ''
Tags
$plugin_id
Plugin ID
public
string
$plugin_id
= 'wcwp_'
Tags
Methods
__construct()
Constructor.
public
__construct([string $name = 'new' ]) : mixed
Parameters
- $name : string = 'new'
-
The wp_role name
Tags
Return values
mixed —admin_options()
Output the shipping settings screen.
public
admin_options() : mixed
Tags
Return values
mixed —get_instance_form_fields()
Get settings fields for instances of the wholesale role
public
get_instance_form_fields() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —get_instance_option()
Gets an option from the settings API, using defaults if necessary to prevent undefined notices.
public
get_instance_option(string $key[, mixed $empty_value = null ]) : mixed
Parameters
- $key : string
-
Key.
- $empty_value : mixed = null
-
Empty value.
Tags
Return values
mixed —The value specified for the option or a default value for the option.
get_option()
Get_option function.
public
get_option(string $key[, mixed $empty_value = null ]) : mixed
Gets and option from the settings API, using defaults if necessary to prevent undefined notices.
Parameters
- $key : string
-
Key.
- $empty_value : mixed = null
-
Empty value.
Tags
Return values
mixed —The value specified for the option or a default value for the option.
init()
Init handler.
public
init() : mixed
Tags
Return values
mixed —init_instance_settings()
Initialise Settings for instances.
public
init_instance_settings() : mixed
Tags
Return values
mixed —process_admin_options()
Processes and saves wholesale roles
public
process_admin_options() : mixed