PHP 클래스 Mlp_Translatable_Post_Data

Data model for post translation. Handles inserts of new posts only.
저자: Inpsyde GmbH, toscho, tf
상속: implements Mlp_Translatable_Post_Data_Interface, implements Mlp_Save_Post_Interface
파일 보기 프로젝트 열기: inpsyde/multilingual-press 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$save_context array

공개 메소드들

메소드 설명
__construct ( $deprecated, array $allowed_post_types, string $link_table, Inpsyde\MultilingualPress\API\ContentRelations $content_relations, Inpsyde\MultilingualPress\Factory\NonceFactory $nonce_factory )
find_post_parents ( string $post_type, integer $post_parent ) : void
get_dummy_post ( string $post_type ) : WP_Post
get_post_meta_to_transfer ( ) : array Return filtered array of post meta data.
get_post_parent ( $blog_id ) : integer
get_real_post_id ( integer $post_id ) : integer Figure out the post ID.
get_real_post_type ( WP_Post $post ) : string Get the real current post type.
get_remote_language ( integer $blog_id ) : string
get_remote_post ( WP_Post $source_post, integer $blog_id ) : WP_Post
save ( integer $post_id, WP_Post $post ) : void
set_linked_element ( integer $source_content_id, integer $remote_site_id, integer $remote_content_id ) : void set the source id of the element
set_save_context ( array $save_context = [] ) : void Set the context of the to-be-saved post.
update_remote_post_meta ( integer $remote_post_id, array $post_meta = [] ) : void Add source post meta to remote post.

메소드 상세

__construct() 공개 메소드

public __construct ( $deprecated, array $allowed_post_types, string $link_table, Inpsyde\MultilingualPress\API\ContentRelations $content_relations, Inpsyde\MultilingualPress\Factory\NonceFactory $nonce_factory )
$deprecated
$allowed_post_types array
$link_table string
$content_relations Inpsyde\MultilingualPress\API\ContentRelations
$nonce_factory Inpsyde\MultilingualPress\Factory\NonceFactory Nonce factory object.

find_post_parents() 공개 메소드

public find_post_parents ( string $post_type, integer $post_parent ) : void
$post_type string
$post_parent integer
리턴 void

get_dummy_post() 공개 메소드

public get_dummy_post ( string $post_type ) : WP_Post
$post_type string
리턴 WP_Post

get_post_meta_to_transfer() 공개 메소드

This function has changed in version 2.1: In earlier versions, we have just used all available post meta keys. That raised too many compatibility issues with other plugins and some themes, so we use an empty array now. If you want to synchronize post meta data, you have to opt-in per filter.
public get_post_meta_to_transfer ( ) : array
리턴 array

get_post_parent() 공개 메소드

public get_post_parent ( $blog_id ) : integer
$blog_id
리턴 integer

get_real_post_id() 공개 메소드

Inspects POST request data and too, because we get two IDs on auto-drafts.
public get_real_post_id ( integer $post_id ) : integer
$post_id integer
리턴 integer

get_real_post_type() 공개 메소드

Includes workaround for auto-drafts.
public get_real_post_type ( WP_Post $post ) : string
$post WP_Post
리턴 string

get_remote_language() 공개 메소드

public get_remote_language ( integer $blog_id ) : string
$blog_id integer
리턴 string

get_remote_post() 공개 메소드

public get_remote_post ( WP_Post $source_post, integer $blog_id ) : WP_Post
$source_post WP_Post
$blog_id integer
리턴 WP_Post

save() 공개 메소드

public save ( integer $post_id, WP_Post $post ) : void
$post_id integer
$post WP_Post
리턴 void

set_linked_element() 공개 메소드

set the source id of the element
public set_linked_element ( integer $source_content_id, integer $remote_site_id, integer $remote_content_id ) : void
$source_content_id integer ID of current element
$remote_site_id integer ID of remote site
$remote_content_id integer ID of remote content
리턴 void

set_save_context() 공개 메소드

Set the context of the to-be-saved post.
public set_save_context ( array $save_context = [] ) : void
$save_context array Save context.
리턴 void

update_remote_post_meta() 공개 메소드

Add source post meta to remote post.
public update_remote_post_meta ( integer $remote_post_id, array $post_meta = [] ) : void
$remote_post_id integer
$post_meta array
리턴 void

프로퍼티 상세

$save_context 공개적으로 프로퍼티

public array $save_context
리턴 array