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. |
return | array |
/** * Return the relation ID for the given blog ID and term taxonomy ID. * * @param int $site_id Blog ID. * @param int $term_taxonomy_id Term taxonomy ID. * * @return string */ public function get_relation_id($site_id, $term_taxonomy_id) { $translation_ids = $this->content_relations->get_existing_translation_ids($site_id, 0, $term_taxonomy_id, 0, 'term'); if (!$translation_ids) { return ''; } $relation = reset($translation_ids); return $relation['ml_source_blogid'] . '-' . $relation['ml_source_elementid']; }