add_filter( 'wcml_js_lock_fields_input_names', 'the_callback_function' );
- 类型
- filter
- 类别
- 更新内容
- WooCommerce Multilingual 版本
- 3.8
说明
添加或移除在翻译产品的 WooCommerce 原生产品编辑器中被锁定的自定义字段输入名称。
参数
传递给此过滤器的参数只有一个:- $names
- (array) 包含自定义字段输入名称的数组。
使用示例
示例
/**
* Add this code to the functions.php file of your theme.
*/
add_filter( 'wcml_js_lock_fields_input_names', 'add_js_lock_fields_input_names' );
function add_js_lock_fields_input_names( $names ){
// Add 2 locked field input names
$names[] = '_base_regular_price';
$names[] = 'bto_style';
return $names;
}
相关钩子
wcml_after_duplicate_product_post_meta, wcml_update_extra_fields, wcml_js_lock_fields_ids, wcml_js_lock_fields_classes, wcml_before_sync_product, wcml_before_sync_product_data