apply_filters( 'wpml_original_element_id', mixed $empty_value, integer $element_id, string $element_type)
- 유형
- filter
- 카테고리
- 사이트 전체 언어 정보
- WPML 버전
- 3.2
설명
- 해당 번역의 ID가 주어지면 원본 언어 글 또는 페이지의 ID를 반환합니다.
인수
- $empty_value
- (mixed) (필수) 일반적으로 필터가 수정할 값입니다. 여기서는 아무것도 필터링하지 않으므로 이 값을 NULL로 설정하세요. 필터 함수가 전체 인수 목록을 실제로 수신하려면 이 값이 필요합니다.
- $element_id
- (integer) (필수) 항목의 ID입니다(글 유형의 경우 post_id, 택소노미 용어의 경우 term_taxonomy_id).
- $element_type
- (string) (선택 사항) 요소의 유형입니다. 글 유형(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 the original post ID of a translated page. $original_id = apply_filters( 'wpml_original_element_id', NULL, 6, '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