self::FEATURE_ENABLED_CHANGED_ACTION хук-событиеWC 7.0.0

Action triggered when a feature is enabled or disabled (the value of the corresponding setting option is changed).

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

add_action( 'self::FEATURE_ENABLED_CHANGED_ACTION', 'wp_kama_self::FEATURE_ENABLED_CHANGED_ACTION_action', 10, 2 );

/**
 * Function for `self::FEATURE_ENABLED_CHANGED_ACTION` action-hook.
 * 
 * @param string $feature_id The id of the feature.
 * @param bool   $enabled    True if the feature has been enabled, false if it has been disabled.
 *
 * @return void
 */
function wp_kama_self::FEATURE_ENABLED_CHANGED_ACTION_action( $feature_id, $enabled ){

	// action...
}
$feature_id(строка)
The id of the feature.
$enabled(true|false)
True if the feature has been enabled, false if it has been disabled.

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

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

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

FeaturesController::process_updated_option()
self::FEATURE_ENABLED_CHANGED_ACTION
woocommerce/src/Internal/Features/FeaturesController.php 477
do_action( self::FEATURE_ENABLED_CHANGED_ACTION, $feature_id, 'yes' === $value );

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

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