woocommerce_feature_description_tip хук-фильтрWC 7.1.0

Filter to customize the description tip that appears under the description of each feature in the features settings page.

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

add_filter( 'woocommerce_feature_description_tip', 'wp_kama_woocommerce_feature_description_tip_filter', 10, 3 );

/**
 * Function for `woocommerce_feature_description_tip` filter-hook.
 * 
 * @param string $desc_tip   The original description tip.
 * @param string $feature_id The id of the feature for which the description tip is being customized.
 * @param bool   $disabled   True if the UI currently prevents changing the enable/disable status of the feature.
 *
 * @return string
 */
function wp_kama_woocommerce_feature_description_tip_filter( $desc_tip, $feature_id, $disabled ){

	// filter...
	return $desc_tip;
}
$desc_tip(строка)
The original description tip.
$feature_id(строка)
The id of the feature for which the description tip is being customized.
$disabled(true|false)
True if the UI currently prevents changing the enable/disable status of the feature.

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

С версии 7.1.0 Введена.

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

FeaturesController::get_setting_for_feature()
woocommerce_feature_description_tip
woocommerce/src/Internal/Features/FeaturesController.php 669
$desc_tip = apply_filters( 'woocommerce_feature_description_tip', $desc_tip, $feature_id, $disabled );

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

woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php 73
self::add_filter( 'woocommerce_feature_description_tip', array( $this, 'handle_feature_description_tip' ), 10, 3 );