PHP Class Mlp_Advanced_Translator_Data

Inheritance: implements Mlp_Advanced_Translator_Data_Interface, implements Mlp_Save_Post_Interface
显示文件 Open project: inpsyde/multilingual-press

Public Methods

Method Description
__construct ( $deprecated, Mlp_Translatable_Post_Data_Interface $basic_data, array $allowed_post_types, Inpsyde\MultilingualPress\API\SiteRelations $relations, Inpsyde\MultilingualPress\Factory\NonceFactory $nonce_factory )
get_id_base ( ) : string Base string for ID attribute in translation view.
get_name_base ( ) : string Base string for name attribute in translation view.
get_taxonomies ( WP_Post $post, integer $blog_id ) : array Wrapper for get_taxonomies_with_terms( $post ).
save ( integer $post_id, WP_Post $post ) : void Save the post to the blogs

Private Methods

Method Description
copy_thumb ( integer $new_id, string $featured_image_path ) : boolean Copy the featured image.
create_post_to_send ( array $post_data, string $post_type, integer $blog_id ) : array Create the default post data for the save() method.
get_featured_image_path ( integer $post_id ) : string Fetch data of original featured image.
get_remote_post_content ( array $data ) : string Prepare the content for the post we want to synchronize.
get_remote_post_excerpt ( array $data ) : string Prepare the excerpt for the post we want to synchronize.
get_remote_post_name ( array $data ) : string Prepare the title for the post we want to synchronize.
get_remote_post_title ( array $data ) : string Prepare the title for the post we want to synchronize.
get_taxonomies_with_terms ( WP_Post $post ) : array Get all existing taxonomies for the given post, including existing terms.
is_auto_draft ( WP_Post $post, array $request ) : boolean Check for hidden auto-draft
is_connectable_status ( WP_Post $post ) : boolean Check post status.
is_empty_remote_post ( string $title, string $content, string $post_type ) : boolean Check if there actually is content in the translation. Prevents creation of emptytranslation drafts.
is_valid_save_request ( WP_Post $post ) : boolean Check if the current request should be processed by save().
set_active_terms ( array $terms, string $taxonomy, WP_Post $post ) : array Mark active terms for the post.
set_remote_tax_terms ( integer $new_id, array $tax_data ) : boolean Update terms for each taxonomy.
sync_post ( array $new_post, integer $post_id, integer $remote_blog_id, boolean $update ) : integer | WP_Error Insert the (updated) post.
taxonomy_is_mutually_exclusive ( string $taxonomy ) : boolean Checks if more than one term can be assigned to a taxonomy.

Method Details

__construct() public method

public __construct ( $deprecated, Mlp_Translatable_Post_Data_Interface $basic_data, array $allowed_post_types, Inpsyde\MultilingualPress\API\SiteRelations $relations, Inpsyde\MultilingualPress\Factory\NonceFactory $nonce_factory )
$deprecated
$basic_data Mlp_Translatable_Post_Data_Interface
$allowed_post_types array
$relations Inpsyde\MultilingualPress\API\SiteRelations
$nonce_factory Inpsyde\MultilingualPress\Factory\NonceFactory Nonce factory object.

get_id_base() public method

Base string for ID attribute in translation view.
public get_id_base ( ) : string
return string

get_name_base() public method

Base string for name attribute in translation view.
public get_name_base ( ) : string
return string

get_taxonomies() public method

Wraps the call into a blog switch.
public get_taxonomies ( WP_Post $post, integer $blog_id ) : array
$post WP_Post
$blog_id integer
return array

save() public method

Save the post to the blogs
public save ( integer $post_id, WP_Post $post ) : void
$post_id integer
$post WP_Post
return void