WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

WC_Settings_Integrations() WC 1.0

WC_Settings_Integrations.

Хуки из класса
Возвращает

Null. Ничего.

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

$WC_Settings_Integrations = new WC_Settings_Integrations();
// use class methods

Методы

  1. __construct()
  2. get_sections()
  3. output()

Код WC Settings Integrations: woocommerce/includes/admin/settings/class-wc-settings-integrations.php WC 4.3.1

<?php
class WC_Settings_Integrations extends WC_Settings_Page {

	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->id    = 'integration';
		$this->label = __( 'Integration', 'woocommerce' );

		if ( isset( WC()->integrations ) && WC()->integrations->get_integrations() ) {
			parent::__construct();
		}
	}

	/**
	 * Get sections.
	 *
	 * @return array
	 */
	public function get_sections() {
		global $current_section;

		$sections = array();

		if ( ! Constants::is_defined( 'WC_INSTALLING' ) ) {
			$integrations = WC()->integrations->get_integrations();

			if ( ! $current_section && ! empty( $integrations ) ) {
				$current_section = current( $integrations )->id;
			}

			if ( sizeof( $integrations ) > 1 ) {
				foreach ( $integrations as $integration ) {
					$title                                      = empty( $integration->method_title ) ? ucfirst( $integration->id ) : $integration->method_title;
					$sections[ strtolower( $integration->id ) ] = esc_html( $title );
				}
			}
		}

		return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
	}

	/**
	 * Output the settings.
	 */
	public function output() {
		global $current_section;

		$integrations = WC()->integrations->get_integrations();

		if ( isset( $integrations[ $current_section ] ) ) {
			$integrations[ $current_section ]->admin_options();
		}
	}
}