(FEATURE_ENABLED_CHANGED_ACTION) action-hookWC 7.0.0

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

Usage

add_action( '(FEATURE_ENABLED_CHANGED_ACTION)', 'wp_kama_FEATURE_ENABLED_CHANGED_ACTION_action', 10, 2 );

/**
 * Function for `(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_FEATURE_ENABLED_CHANGED_ACTION_action( $feature_id, $enabled ){

	// action...
}
$feature_id(string)
The id of the feature.
$enabled(true|false)
True if the feature has been enabled, false if it has been disabled.

Changelog

Since 7.0.0 Introduced.

Where the hook is called

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

Where the hook is used in WooCommerce

Usage not found.