WPML
add_filter( 'wcml_product_content_label', 'the_callback_function', 10, 2 );
类别
插入内容
WooCommerce Multilingual 版本
3.6

说明

在 WCML 翻译编辑器中修改自定义字段名称。

参数

有两个参数传递给此过滤器:
$meta_key
(字符串) 自定义字段键。
$product_id
(整数) 原始产品的 ID。

使用示例

示例
/*
 * Add this code to the functions.php file of your theme.
 */

add_filter( 'wcml_product_content_label', 'change_field_label', 10, 2 );

function change_field_label( $meta_key, $product_id ) {

	// Change the label of 'new_button_label' field in WCML Translation Editor 

	if ( $meta_key == 'new_button_label' ) {
		return __( 'Translate New Button Label', 'textdomain' );
	}

	return $meta_key;
}

wcml_after_duplicate_product, wcml_product_content_fields

所有 3 个 插入内容 钩子 →