Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders

PaymentGateway::get_descriptionpublicWC 1.0

Get the provider description of the payment gateway.

This is the intended gateway description to use throughout the WC admin. It should be short and to the point.

Note: We don't allow HTML tags in the description. All HTML tags will be stripped, including their contents.

Method of the class: PaymentGateway{}

No Hooks.

Returns

String. The provider description of the payment gateway.

Usage

$PaymentGateway = new PaymentGateway();
$PaymentGateway->get_description( $payment_gateway ): string;
$payment_gateway(WC_Payment_Gateway) (required)
The payment gateway object.

PaymentGateway::get_description() code WC 9.9.4

public function get_description( WC_Payment_Gateway $payment_gateway ): string {
	$description = $payment_gateway->get_method_description();
	if ( ! is_string( $description ) || empty( $description ) ) {
		return '';
	}
	$description = wp_strip_all_tags( html_entity_decode( $description, ENT_QUOTES | ENT_SUBSTITUTE ), true );

	// Truncate the description.
	return Utils::truncate_with_words( $description, 130, '…' );
}