WC_Payment_Gateway::has_fields PHP 메소드

has_fields() 공개 메소드

Check if the gateway has fields on the checkout.
public has_fields ( ) : boolean
리턴 boolean
    public function has_fields()
    {
        return $this->has_fields ? true : false;
    }

Usage Example

 /**
  * Sanitize payment fields
  * - some gateways include js in their payment fields
  *
  * @param WC_Payment_Gateway $gateway
  * @return mixed|string
  */
 protected function sanitize_payment_fields(WC_Payment_Gateway $gateway)
 {
     $html = '';
     if ($gateway->has_fields() || $gateway->get_description()) {
         ob_start();
         $gateway->payment_fields();
         $html = ob_get_contents();
         ob_end_clean();
         // remove script tags
         $html = $this->removeDomNodes($html, '//script');
     }
     return self::trim_html_string($html);
 }
All Usage Examples Of WC_Payment_Gateway::has_fields