Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders

PaymentGateway::get_titlepublicWC 1.0

Get the provider title of the payment gateway.

This is the intended gateway title to use throughout the WC admin. It should be short.

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

Method of the class: PaymentGateway{}

No Hooks.

Returns

String. The provider title of the payment gateway.

Usage

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

PaymentGateway::get_title() code WC 9.9.4

public function get_title( WC_Payment_Gateway $payment_gateway ): string {
	$title = $payment_gateway->get_method_title();
	if ( ! is_string( $title ) || empty( $title ) ) {
		return esc_html__( 'Unknown', 'woocommerce' );
	}
	$title = wp_strip_all_tags( html_entity_decode( $title, ENT_QUOTES | ENT_SUBSTITUTE ), true );

	// Truncate the title.
	return Utils::truncate_with_words( $title, 75 );
}