WPML
add_filter( 'wcml_js_lock_fields_ids', 'the_callback_function' );
类型
filter
类别
更新内容
WooCommerce Multilingual 版本
3.8

说明

添加或移除在已翻译产品的 WooCommerce 原生产品编辑器中锁定的自定义字段 ID。

参数

传递给此过滤器的参数只有一个:
$ids
(array) 包含自定义字段 ID 的数组。

使用示例

示例
/**
 * Add this code to the functions.php file of your theme.
 */
add_filter( 'wcml_js_lock_fields_ids', 'add_js_lock_fields_ids' );

function add_js_lock_fields_ids( $ids ){

	// Add 2 locked field IDs
	$ids[] = '_per_product_pricing_bto';
	$ids[] = '_per_product_shipping_bto';

	return $ids;
}

wcml_after_duplicate_product_post_meta, wcml_update_extra_fields, wcml_js_lock_fields_input_names, wcml_js_lock_fields_classes, wcml_before_sync_product, wcml_before_sync_product_data

所有 7 个 更新内容 钩子 →