WC_Gateway_Paypal::get_icon()publicWC 1.0

Get gateway icon.

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

Хуки из метода

Возвращает

Строку.

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

$WC_Gateway_Paypal = new WC_Gateway_Paypal();
$WC_Gateway_Paypal->get_icon();

Код WC_Gateway_Paypal::get_icon() WC 8.7.0

public function get_icon() {
	// We need a base country for the link to work, bail if in the unlikely event no country is set.
	$base_country = WC()->countries->get_base_country();
	if ( empty( $base_country ) ) {
		return '';
	}
	$icon_html = '';
	$icon      = (array) $this->get_icon_image( $base_country );

	foreach ( $icon as $i ) {
		$icon_html .= '<img src="' . esc_attr( $i ) . '" alt="' . esc_attr__( 'PayPal acceptance mark', 'woocommerce' ) . '" />';
	}

	$icon_html .= sprintf( '<a href="%1$s" class="about_paypal" onclick="javascript:window.open(\'%1$s\',\'WIPaypal\',\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700\'); return false;">' . esc_attr__( 'What is PayPal?', 'woocommerce' ) . '</a>', esc_url( $this->get_icon_url( $base_country ) ) );

	return apply_filters( 'woocommerce_gateway_icon', $icon_html, $this->id );
}