WC_Email_Customer_Invoice::init_form_fields PHP Метод

init_form_fields() публичный Метод

Initialise settings form fields.
public init_form_fields ( )
        public function init_form_fields()
        {
            $this->form_fields = array('subject' => array('title' => __('Email subject', 'woocommerce'), 'type' => 'text', 'description' => sprintf(__('Defaults to %s', 'woocommerce'), '<code>' . $this->subject . '</code>'), 'placeholder' => '', 'default' => '', 'desc_tip' => true), 'heading' => array('title' => __('Email heading', 'woocommerce'), 'type' => 'text', 'description' => sprintf(__('Defaults to %s', 'woocommerce'), '<code>' . $this->heading . '</code>'), 'placeholder' => '', 'default' => '', 'desc_tip' => true), 'subject_paid' => array('title' => __('Email subject (paid)', 'woocommerce'), 'type' => 'text', 'description' => sprintf(__('Defaults to %s', 'woocommerce'), '<code>' . $this->subject_paid . '</code>'), 'placeholder' => '', 'default' => '', 'desc_tip' => true), 'heading_paid' => array('title' => __('Email heading (paid)', 'woocommerce'), 'type' => 'text', 'description' => sprintf(__('Defaults to %s', 'woocommerce'), '<code>' . $this->heading_paid . '</code>'), 'placeholder' => '', 'default' => '', '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));
        }

Usage Example

 /**
  * Initialise Settings Form Fields, but add an enable/disable field
  * to this email as WC doesn't include that for customer Invoices.
  *
  * @access public
  * @return void
  */
 function init_form_fields()
 {
     parent::init_form_fields();
     $this->form_fields = array_merge(array('enabled' => array('title' => __('Enable/Disable', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable this email notification', 'woocommerce'), 'default' => 'yes')), $this->form_fields);
 }
All Usage Examples Of WC_Email_Customer_Invoice::init_form_fields