Automattic\WooCommerce\Internal\Admin\Settings

SettingsUIRequestContext::apply_section_navigation │ private │ WC 1.0

Set the shell section navigation from the page registration.

Top-level pages never carry section navigation: the classic section links render with the settings header instead. Drill-down pages keep schema-provided navigation and default to none, since the header breadcrumbs replace it.

Method of the class: SettingsUIRequestContext{}

No Hooks.

Returns

array.

Usage

// private - for code of main (parent) class only
$result = $this->apply_section_navigation( $schema ): array;
$schema(array) (required)
Resolved settings UI schema.

SettingsUIRequestContext::apply_section_navigation() code WC 11.1.2

private function apply_section_navigation( array $schema ): array {
	if ( ! isset( $schema['shell'] ) || ! is_array( $schema['shell'] ) ) {
		$schema['shell'] = array();
	}

	if ( ! $this->is_drill_down() || ! isset( $schema['shell']['sectionNavigation'] ) ) {
		$schema['shell']['sectionNavigation'] = array();
	}

	return $schema;
}