WPML
apply_filters( 'wpml_post_duplicates', int $master_post_id )
유형
filter
WPML 버전
3.2

설명

원본 글 ID에서 복제된 글 ID를 반환합니다.

인수

$master_post_id
(int) (필수) 복제본이 존재하는 원본 글 ID입니다.

사용 예시

예제
// $my_duplications will return an associative array with language codes as indexes and post_ids as values
$my_duplications = apply_filters( 'wpml_post_duplicates', 28 );

결과는 다음과 같습니다.
Array
(
    [de] => 30
    [el] => 73
)

복제본을 생성하기 위한 원본 글로 사용되지 않은 글 ID를 전달하면 필터는 빈 배열을 반환합니다. 이를 더 명확하게 이해하려면 아래 예제를 위의 예제와 비교해 보세요.
예제
// note that I use post ID 30 This is the German duplicated post from the first example above
$my_duplications = apply_filters( 'wpml_post_duplicates', 30 );

그리고 결과는 다음과 같습니다.
Array
(
)

wpml_element_translation_type, wpml_is_translated_post_type, wpml_is_translated_taxonomy, wpml_master_post_from_duplicate, wpml_element_has_translations

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