WC_Settings_Shipping::get_own_sections()protectedWC 1.0

Get own sections.

Метод класса: WC_Settings_Shipping{}

Хуков нет.

Возвращает

Массив.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_own_sections();

Код WC_Settings_Shipping::get_own_sections() WC 8.7.0

protected function get_own_sections() {
	$sections = array(
		''        => __( 'Shipping zones', 'woocommerce' ),
		'options' => __( 'Shipping settings', 'woocommerce' ),
		'classes' => __( 'Classes', 'woocommerce' ),
	);

	if ( ! $this->wc_is_installing() ) {
		// Load shipping methods so we can show any global options they may have.
		$shipping_methods = $this->get_shipping_methods();

		foreach ( $shipping_methods as $method ) {
			if ( ! $method->has_settings() ) {
				continue;
			}
			$title                                 = empty( $method->method_title ) ? ucfirst( $method->id ) : $method->method_title;
			$sections[ strtolower( $method->id ) ] = esc_html( $title );
		}
	}

	return $sections;
}