WooCommerce Code Reference

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

Methods

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
since
11.2.0
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
since
3.0.0
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
since
3.0.0
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
since
3.0.0
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
since
3.0.0
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.

Tags
since
3.0.0
Return values
array<string|int, mixed>|bool —