woocommerce_feature_setting
Allows to modify feature setting that will be used to render in the feature page.
Использование
add_filter( 'woocommerce_feature_setting', 'wp_kama_woocommerce_feature_setting_filter', 10, 2 ); /** * Function for `woocommerce_feature_setting` filter-hook. * * @param array $feature_setting The feature setting. Describes the feature: ```php - title: The title of the feature. - desc: The description of the feature. Will be displayed under the title. - type: The type of the feature. Could be any of supported settings types from `WC_Admin_Settings::output_fields`, but if it's anything other than checkbox or radio, it will need custom handling. - id: The id of the feature. Will be used as the name of the setting. - disabled: Whether the feature is disabled or not. - desc_tip: The description tip of the feature. Will be displayed as a tooltip next to the description. - tooltip: The tooltip of the feature. Will be displayed as a tooltip next to the name. - default: The default value of the feature.
- @param string $feature_id The id of the feature.
-
@return array
*/
function wp_kama_woocommerce_feature_setting_filter( $feature_setting, $feature_id ){// filter...
return $feature_setting;
}
- $feature_setting(массив)
- The feature setting. Describes the feature:
```php
- title: The title of the feature.
- desc: The description of the feature. Will be displayed under the title.
- type: The type of the feature. Could be any of supported settings types from WC_Admin_Settings::output_fields, but if it's anything other than checkbox or radio, it will need custom handling.
- id: The id of the feature. Will be used as the name of the setting.
- disabled: Whether the feature is disabled or not.
- desc_tip: The description tip of the feature. Will be displayed as a tooltip next to the description.
- tooltip: The tooltip of the feature. Will be displayed as a tooltip next to the name.
- default: The default value of the feature.
$feature_id *(строка)* : The id of the feature.
Список изменений
С версии 8.0.0 | Введена. |
Где вызывается хук
woocommerce/src/Internal/Features/FeaturesController.php 976
return apply_filters( 'woocommerce_feature_setting', $feature_setting, $feature_id );