(FEATURE_ENABLED_CHANGED_ACTION)
Action triggered when a feature is enabled or disabled (the value of the corresponding setting option is changed).
Использование
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(строка)
- The id of the feature.
- $enabled(true|false)
- True if the feature has been enabled, false if it has been disabled.
Список изменений
С версии 7.0.0 | Введена. |
Где вызывается хук
(FEATURE_ENABLED_CHANGED_ACTION)
woocommerce/src/Internal/Features/FeaturesController.php 660
do_action( self::FEATURE_ENABLED_CHANGED_ACTION, $feature_id, 'yes' === $value );