PHP Interface Inpsyde\MultilingualPress\API\ContentRelations

Since: 3.0.0
Afficher le fichier Open project: inpsyde/multilingual-press Interface Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

delete_relation() public méthode

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.
Résultat integer Number of deleted rows

duplicate_relations() public méthode

This method is suited to be used after site duplication, because both sites are assumed to have the exact same content IDs.
Since: 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.
Résultat integer The number of relations duplicated.

get_element_for_site() public méthode

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.
Résultat integer

get_existing_translation_ids() public méthode

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.
Résultat array

get_relations() public méthode

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.
Résultat array

get_translation_ids() public méthode

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.
Résultat array

has_site_relations() public méthode

Checks if the site with the given ID has any relations of the given (or any) content type.
Since: 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.
Résultat boolean Whether or not the site with the given ID has any relations of the given (or any) content type.

relate_all_posts() public méthode

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.
Since: 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.
Résultat integer The number of relations inserted.

relate_all_terms() public méthode

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.
Since: 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.
Résultat integer The number of relations inserted.

set_relation() public méthode

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.
Résultat boolean