woocommerce_gateway_description хук-фильтрWC 1.5.8

Filters the gateway description.

Descriptions can be overridden by extending this method or through the use of woocommerce_gateway_description avoid breaking custom HTML that may be returned we cannot enforce KSES at render time, so we run it here.

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

add_filter( 'woocommerce_gateway_description', 'wp_kama_woocommerce_gateway_description_filter', 10, 2 );

/**
 * Function for `woocommerce_gateway_description` filter-hook.
 * 
 * @param string $description Gateway description.
 * @param string $id          Gateway ID.
 *
 * @return string
 */
function wp_kama_woocommerce_gateway_description_filter( $description, $id ){

	// filter...
	return $description;
}
$description(строка)
Gateway description.
$id(строка)
Gateway ID.

Список изменений

С версии 1.5.8 Введена.
С версии 9.0.0 wp_kses_post() is used to sanitize the description before passing it to the filter.

Где вызывается хук

WC_Payment_Gateway::get_description()
woocommerce_gateway_description
woocommerce/includes/abstracts/abstract-wc-payment-gateway.php 371
return apply_filters( 'woocommerce_gateway_description', wp_kses_post( $this->description ), $this->id );

Где используется хук в WooCommerce

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