WC_Register_WP_Admin_Settings::__construct( WC_Email|WC_Settings_Page $object, string $type )

Hooks into the settings API and starts registering our settings.


Description Description


Parameters Parameters

$object

(Required) The object that contains the settings to register.

$type

(Required) Type of settings to register (email or page).


Top ↑

Source Source

File: includes/class-wc-register-wp-admin-settings.php

	public function __construct( $object, $type ) {
		if ( ! is_object( $object ) ) {
			return;
		}

		$this->object = $object;

		if ( 'page' === $type ) {
			add_filter( 'woocommerce_settings_groups', array( $this, 'register_page_group' ) );
			add_filter( 'woocommerce_settings-' . $this->object->get_id(), array( $this, 'register_page_settings' ) );
		} elseif ( 'email' === $type ) {
			add_filter( 'woocommerce_settings_groups', array( $this, 'register_email_group' ) );
			add_filter( 'woocommerce_settings-email_' . $this->object->id, array( $this, 'register_email_settings' ) );
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.