add_filter( 'wcml_product_content_label', 'the_callback_function', 10, 2 );
- カテゴリー
- コンテンツの挿入
- WooCommerce Multilingualバージョン
- 3.6
説明
WCML翻訳エディタでカスタムフィールド名を変更します。
引数
このフィルターには2つのパラメーターが渡されます。- $meta_key
- (string) カスタムフィールドキー。
- $product_id
- (integer) オリジナル商品の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;
}