add_filter( 'wcml_product_content_fields', 'the_callback_function', 10, 2 );
- タイプ
- filter
- カテゴリー
- コンテンツの挿入
- WooCommerce Multilingualバージョン
- 3.6
説明
WCML翻訳エディタでカスタムフィールドを追加または削除します。
引数
このフィルターには2つのパラメーターが渡されます。- $fields
- (配列)カスタムフィールドの配列。
- $product_id
- (整数)オリジナル製品のID。
使用例
例
/*
* Add this code to the functions.php file of your theme.
*/
add_filter( 'wcml_product_content_fields', 'add_custom_fields_wcml_editor', 10, 2 );
function add_custom_fields_wcml_editor ( $fields, $product_id ) {
// Add the 'new_button_label' field to WCML Translation Editor
$fields[] = 'new_button_label';
return $fields;
}