WPML
apply_filters( 'wpml_element_trid', mixed $empty_value, integer $element_id, string $element_type)
유형
filter
WPML 버전
3.3.5

설명

  • 이 인수를 필요로 하는 wpml_get_element_translations 필터 및 기타 항목에 필수인 번역된 요소의 trid(번역 그룹의 ID)를 가져오세요.
  • WPML의 테이블 문서 페이지에서 trid에 대해 자세히 알아보세요.

인수

$empty_value
(mixed) (필수) 이것은 일반적으로 필터가 수정할 값입니다. 여기서는 아무것도 필터링하지 않으므로 이 값을 NULL로 설정하세요. 필터 함수가 전체 인수 목록을 실제로 수신하려면 이 값이 필요합니다.
$element_id
(정수) (필수) 항목의 ID입니다(글 유형의 경우 post_id, 택소노미 용어의 경우 term_taxonomy_id).
$element_type
(문자열) (선택 사항) 요소의 유형입니다. 글 유형(post_post, post_page, post_attachment, post_nav_menu_item, post_{custom post key}) 또는 택소노미(tax_category, tax_post_tag, tax_nav_menu, tax_{custom taxonomy key})일 수 있습니다. 설정하지 않으면 기본값은 post_post입니다.

사용 예시

예제
// Get "trid" of the "Sample Page" page. 
$trid = apply_filters( 'wpml_element_trid', NULL, 2, 'post_page' );

wpml_decode_custom_field, wpml_footer_language_selector, wpml_add_language_form_field, wpml_ls_exclude_in_menu, wpml_is_rtl, wpml_alternate_hreflang, wpml_head_langs, wpml_must_translate_canonical_url, wpml_browser_redirect_language_params, wpml_active_languages

모든 사이트 전체 언어 정보 훅 29개 →