WC_Register_WP_Admin_Settings
in package
Register WP admin settings class.
Table of Contents
- $object : WC_Register_WP_Admin_Settings
- Contains the current class to pull settings from.
- $type : string
- Type of settings the wrapped object holds ('page' or 'email').
- __construct() : mixed
- Hooks into the settings API and starts registering our settings.
- register() : void
- Attaches the filters that expose the wrapped object's settings to the Settings REST API.
- register_email_group() : array<string|int, mixed>
- Register's all of our different notification emails as sub groups of email settings.
- register_email_settings() : array<string|int, mixed>
- Registers all of the setting form fields for emails to each email type's group.
- register_page_group() : array<string|int, mixed>
- Registers a setting group, based on admin page ID & label as parent group.
- register_page_settings() : array<string|int, mixed>
- Registers settings to a specific group.
- register_setting() : array<string|int, mixed>|bool
- Register a setting into the format expected for the Settings REST API.
Properties
$object
Contains the current class to pull settings from.
protected
WC_Register_WP_Admin_Settings
$object
Either a admin page object or WC_Email object
$type
Type of settings the wrapped object holds ('page' or 'email').
protected
string
$type
Tags
Methods
__construct()
Hooks into the settings API and starts registering our settings.
public
__construct(WC_Email|WC_Settings_Page $object, string $type) : mixed
Parameters
- $object : WC_Email|WC_Settings_Page
-
The object that contains the settings to register.
- $type : string
-
Type of settings to register (email or page).
Tags
Return values
mixed —register()
Attaches the filters that expose the wrapped object's settings to the Settings REST API.
public
register() : void
Called from the constructor; safe to call again to re-attach after hook state has been reset. Repeat calls re-add the same callbacks, which WordPress stores under the same identifiers, so they never duplicate registered groups or settings.
Tags
Return values
void —register_email_group()
Register's all of our different notification emails as sub groups of email settings.
public
register_email_group(array<string|int, mixed> $groups) : array<string|int, mixed>
Parameters
- $groups : array<string|int, mixed>
-
Existing registered groups.
Tags
Return values
array<string|int, mixed> —register_email_settings()
Registers all of the setting form fields for emails to each email type's group.
public
register_email_settings(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
- $settings : array<string|int, mixed>
-
Existing registered settings.
Tags
Return values
array<string|int, mixed> —register_page_group()
Registers a setting group, based on admin page ID & label as parent group.
public
register_page_group(array<string|int, mixed> $groups) : array<string|int, mixed>
Parameters
- $groups : array<string|int, mixed>
-
Array of previously registered groups.
Tags
Return values
array<string|int, mixed> —register_page_settings()
Registers settings to a specific group.
public
register_page_settings(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
- $settings : array<string|int, mixed>
-
Existing registered settings.
Tags
Return values
array<string|int, mixed> —register_setting()
Register a setting into the format expected for the Settings REST API.
public
register_setting(array<string|int, mixed> $setting) : array<string|int, mixed>|bool
Parameters
- $setting : array<string|int, mixed>
-
Setting data.
