WPML
apply_filters( 'wpml_master_post_from_duplicate', int $post_id )
Loại
filter
Phiên bản WPML
3.2

Miêu tả

Trả về ID bài viết gốc từ ID bài viết được nhân bản

Đối số

$post_id
(int) (Bắt buộc) ID bài viết được nhân bản

Ví dụ sử dụng

Ví dụ
// $my_original_post will return the original post ID which was used to create post ID 30
$my_original_post = apply_filters( 'wpml_master_post_from_duplicate', 30 )

Nếu biến trên trả về một chuỗi văn bản rỗng, điều này sẽ cho thấy rằng bài viết có ID 30 không phải là một bài viết được nhân bản.

wpml_element_translation_type, wpml_is_translated_post_type, wpml_is_translated_taxonomy, wpml_post_duplicates, wpml_element_has_translations

Tất cả 6 hook Tìm trạng thái dịch thuật của nội dung →