WC_Email_Customer_Invoice::init_form_fields()publicWC 1.0

Initialise settings form fields.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$WC_Email_Customer_Invoice = new WC_Email_Customer_Invoice();
$WC_Email_Customer_Invoice->init_form_fields();

Код WC_Email_Customer_Invoice::init_form_fields() WC 9.4.2

public function init_form_fields() {
	/* translators: %s: list of placeholders */
	$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
	$this->form_fields = array(
		'subject'            => array(
			'title'       => __( 'Subject', 'woocommerce' ),
			'type'        => 'text',
			'desc_tip'    => true,
			'description' => $placeholder_text,
			'placeholder' => $this->get_default_subject(),
			'default'     => '',
		),
		'heading'            => array(
			'title'       => __( 'Email heading', 'woocommerce' ),
			'type'        => 'text',
			'desc_tip'    => true,
			'description' => $placeholder_text,
			'placeholder' => $this->get_default_heading(),
			'default'     => '',
		),
		'subject_paid'       => array(
			'title'       => __( 'Subject (paid)', 'woocommerce' ),
			'type'        => 'text',
			'desc_tip'    => true,
			'description' => $placeholder_text,
			'placeholder' => $this->get_default_subject( true ),
			'default'     => '',
		),
		'heading_paid'       => array(
			'title'       => __( 'Email heading (paid)', 'woocommerce' ),
			'type'        => 'text',
			'desc_tip'    => true,
			'description' => $placeholder_text,
			'placeholder' => $this->get_default_heading( true ),
			'default'     => '',
		),
		'additional_content' => array(
			'title'       => __( 'Additional content', 'woocommerce' ),
			'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
			'css'         => 'width:400px; height: 75px;',
			'placeholder' => __( 'N/A', 'woocommerce' ),
			'type'        => 'textarea',
			'default'     => $this->get_default_additional_content(),
			'desc_tip'    => true,
		),
		'email_type'         => array(
			'title'       => __( 'Email type', 'woocommerce' ),
			'type'        => 'select',
			'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
			'default'     => 'html',
			'class'       => 'email_type wc-enhanced-select',
			'options'     => $this->get_email_type_options(),
			'desc_tip'    => true,
		),
	);
}