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;
}