WPML
add_filter( 'wcml_product_content_fields', 'the_callback_function', 10, 2 );
유형
filter
카테고리
콘텐츠 삽입
WooCommerce Multilingual 버전
3.6

설명

WCML 번역 에디터에서 사용자 정의 필드를 추가하거나 제거하세요.

인수

이 필터에는 두 개의 매개변수가 전달됩니다:
$fields
(array) 사용자 정의 필드 배열.
$product_id
(integer) 원본 상품의 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;
}

wcml_after_duplicate_product, wcml_product_content_label

모든 콘텐츠 삽입 훅 3개 →