Automattic\WooCommerce\Internal\Admin\ProductForm

Tab::__construct()publicWC 1.0

Constructor

Method of the class: Tab{}

No Hooks.

Return

null. Nothing (null).

Usage

$Tab = new Tab();
$Tab->__construct( $id, $plugin_id, $additional_args );
$id(string) (required)
Field id.
$plugin_id(string) (required)
Plugin id.
$additional_args(array) (required)
Array containing the necessary arguments.
php $args = array( 'name' => (string) Tab name. Required. 'title' => (string) Tab title. Required. 'order' => (int) Tab order. 'properties' => (array) Tab properties. ).

Tab::__construct() code WC 8.9.0

public function __construct( $id, $plugin_id, $additional_args ) {
	parent::__construct( $id, $plugin_id, $additional_args );

	$this->required_arguments = array(
		'name',
		'title',
	);

	$missing_arguments = self::get_missing_arguments( $additional_args );
	if ( count( $missing_arguments ) > 0 ) {
		throw new \Exception(
			sprintf(
			/* translators: 1: Missing arguments list. */
				esc_html__( 'You are missing required arguments of WooCommerce ProductForm Tab: %1$s', 'woocommerce' ),
				join( ', ', $missing_arguments )
			)
		);
	}
}