WPML
apply_filters( 'wpml_element_has_translations', mixed $empty_value, int $element_id, string $element_type )
유형
filter
WPML 버전
3.2

설명

포스트 유형 또는 택소노미 용어가 번역되었는지 여부에 따라 TRUE 또는 FALSE를 반환합니다.

인수

$empty_value
(mixed) (필수) 일반적으로 필터가 수정할 값입니다. 여기서는 아무것도 필터링하지 않으므로 NULL로 설정하세요. 이는 필터 함수가 전체 인수 목록을 실제로 수신하도록 하기 위함입니다.
$element_id
(int) (필수) 정보를 검색할 요소 ID입니다. 택소노미 용어에는 term_id를 사용하고 글 유형에는 post_id를 사용하세요.
$element_type
(string) (필수) ID가 속한 요소의 유형입니다. 글 유형(post, page, attachment, nav_menu_item, {custom post key}) 또는 택소노미(category, post_tag, nav_menu {custom taxonomy key})일 수 있습니다.

사용 예시

예제
//$is_translated will be TRUE if the custom post is translated and FALSE if it is not translated
$is_translated = apply_filters( 'wpml_element_has_translations', NULL, 61, 'book' )

wpml_element_translation_type, wpml_is_translated_post_type, wpml_is_translated_taxonomy, wpml_master_post_from_duplicate, wpml_post_duplicates

모든 콘텐츠의 번역 상태 확인 훅 6개 →