PHP 인터페이스 Inpsyde\MultilingualPress\API\ContentRelations

부터: 3.0.0
파일 보기 프로젝트 열기: inpsyde/multilingual-press 0 사용 예제들

공개 메소드들

메소드 설명
delete_relation ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type = 'post' ) : integer Delete a relation according to the given parameters.
duplicate_relations ( integer $source_site_id, integer $destination_site_id, string $type = '' ) : integer Copies all relations of the given (or any) content type from the given source site to the given destination site.
get_element_for_site ( integer $source_site_id, integer $target_site_id, integer $source_content_id, string $type ) : integer Return the term taxonomy ID of the given target site for the given source term.
get_existing_translation_ids ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : array Return the existing translation IDs according to the given parameters.
get_relations ( integer $source_site_id, integer $source_content_id, string $type = 'post' ) : array Return an array with site IDs as keys and content IDs as values.
get_translation_ids ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : array Return the existing (or new) translation IDs according to the given parameters.
has_site_relations ( integer $site_id, string $type = '' ) : boolean Checks if the site with the given ID has any relations of the given (or any) content type.
relate_all_posts ( integer $source_site_id, integer $destination_site_id ) : integer Relates all posts between the given source site and the given destination site.
relate_all_terms ( integer $source_site_id, integer $destination_site_id ) : integer Relates all terms between the given source site and the given destination site.
set_relation ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type = 'post' ) : boolean Set a relation according to the given parameters.

메소드 상세

delete_relation() 공개 메소드

Delete a relation according to the given parameters.
public delete_relation ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type = 'post' ) : integer
$source_site_id integer Source blog ID.
$target_site_id integer Target blog ID.
$source_content_id integer Source post ID or term taxonomy ID.
$target_content_id integer Target post ID or term taxonomy ID.
$type string Content type.
리턴 integer Number of deleted rows

duplicate_relations() 공개 메소드

This method is suited to be used after site duplication, because both sites are assumed to have the exact same content IDs.
부터: 3.0.0
public duplicate_relations ( integer $source_site_id, integer $destination_site_id, string $type = '' ) : integer
$source_site_id integer Source site ID.
$destination_site_id integer Destination site ID.
$type string Optional. Content type. Defaults to empty string.
리턴 integer The number of relations duplicated.

get_element_for_site() 공개 메소드

Return the term taxonomy ID of the given target site for the given source term.
public get_element_for_site ( integer $source_site_id, integer $target_site_id, integer $source_content_id, string $type ) : integer
$source_site_id integer Source blog ID.
$target_site_id integer Target blog ID.
$source_content_id integer Source post ID or term taxonomy ID.
$type string Content type.
리턴 integer

get_existing_translation_ids() 공개 메소드

Return the existing translation IDs according to the given parameters.
public get_existing_translation_ids ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : array
$source_site_id integer Source blog ID.
$target_site_id integer Target blog ID.
$source_content_id integer Source post ID or term taxonomy ID.
$target_content_id integer Target post ID or term taxonomy ID.
$type string Content type.
리턴 array

get_relations() 공개 메소드

Return an array with site IDs as keys and content IDs as values.
public get_relations ( integer $source_site_id, integer $source_content_id, string $type = 'post' ) : array
$source_site_id integer Source blog ID.
$source_content_id integer Source post ID or term taxonomy ID.
$type string Content type.
리턴 array

get_translation_ids() 공개 메소드

Return the existing (or new) translation IDs according to the given parameters.
public get_translation_ids ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : array
$source_site_id integer Source blog ID.
$target_site_id integer Target blog ID.
$source_content_id integer Source post ID or term taxonomy ID.
$target_content_id integer Target post ID or term taxonomy ID.
$type string Content type.
리턴 array

has_site_relations() 공개 메소드

Checks if the site with the given ID has any relations of the given (or any) content type.
부터: 3.0.0
public has_site_relations ( integer $site_id, string $type = '' ) : boolean
$site_id integer Site ID.
$type string Optional. Content type. Defaults to empty string.
리턴 boolean Whether or not the site with the given ID has any relations of the given (or any) content type.

relate_all_posts() 공개 메소드

This method is suited to be used after site duplication, because both sites are assumed to have the exact same post IDs. Furthermore, the current site is assumed to be either the source site or the destination site.
부터: 3.0.0
public relate_all_posts ( integer $source_site_id, integer $destination_site_id ) : integer
$source_site_id integer Source site ID.
$destination_site_id integer Destination site ID.
리턴 integer The number of relations inserted.

relate_all_terms() 공개 메소드

This method is suited to be used after site duplication, because both sites are assumed to have the exact same term taxonomy IDs. Furthermore, the current site is assumed to be either the source site or the destination site.
부터: 3.0.0
public relate_all_terms ( integer $source_site_id, integer $destination_site_id ) : integer
$source_site_id integer Source site ID.
$destination_site_id integer Destination site ID.
리턴 integer The number of relations inserted.

set_relation() 공개 메소드

Set a relation according to the given parameters.
public set_relation ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type = 'post' ) : boolean
$source_site_id integer Source blog ID.
$target_site_id integer Target blog ID.
$source_content_id integer Source post ID or term taxonomy ID.
$target_content_id integer Target post ID or term taxonomy ID.
$type string Content type.
리턴 boolean