WooCommerce Code Reference

SettingsSectionRegistry
in package

Registry for sections that extensions add to existing WooCommerce settings pages.

Tags
since
10.9.0

Table of Contents

$initialized  : bool
Whether the registration action has fired.
$instance  : SettingsSectionRegistry|null
Singleton instance.
$sections  : array<string|int, mixed>
Registered sections keyed by parent page id and section id.
get_instance()  : SettingsSectionRegistry
Get the registry instance.
get_registered()  : SettingsSectionInterface|null
Get a registered section.
get_sections_for_page()  : array<string, string>
Get registered section labels for a settings page.
register()  : bool
Register a settings section.
unregister_all()  : void
Clear all registered sections.
initialize()  : void
Fire the section registration action once.
is_reserved_checkout_section_id()  : bool
Check whether a checkout section id is reserved by an existing payment gateway.
normalize_id()  : string
Normalize page and section identifiers.

Properties

Methods

get_sections_for_page()

Get registered section labels for a settings page.

public get_sections_for_page(string $parent_page_id) : array<string, string>
Parameters
$parent_page_id : string

Parent settings page id.

Tags
since
10.9.0
Return values
array<string, string>

is_reserved_checkout_section_id()

Check whether a checkout section id is reserved by an existing payment gateway.

private is_reserved_checkout_section_id(string $parent_page_id, string $section_id) : bool
Parameters
$parent_page_id : string

Parent settings page id.

$section_id : string

Section id.

Return values
bool