Automattic\WooCommerce\Internal\ProductCustoms

ClassicEditorFields::get_field_args │ private │ WC 1.0

Field arguments that differ between the product form and a variation row.

Method of the class: ClassicEditorFields{}

No Hooks.

Returns

array.

Usage

// private - for code of main (parent) class only
$result = $this->get_field_args( $property, ?int $loop ): array;
$property(string) (required)
Customs prop name.
?int $loop(required)
.

ClassicEditorFields::get_field_args() code WC 11.3.0

private function get_field_args( string $property, ?int $loop ): array {
	if ( null === $loop ) {
		return array(
			'id'       => '_' . $property,
			'name'     => '_' . $property,
			'desc_tip' => true,
		);
	}

	return array(
		'id'            => 'variable_' . $property . $loop,
		'name'          => 'variable_' . $property . '[' . $loop . ']',
		'wrapper_class' => 'form-row form-row-full',
		'desc_tip'      => true,
	);
}