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.
 /**
  * Sets up content relations between the source site and the new site.
  *
  * @param int $source_site_id      The ID of the source site.
  * @param int $destination_site_id The ID of the new site.
  *
  * @return void
  */
 private function handle_content_relations($source_site_id, $destination_site_id)
 {
     if ($this->content_relations->has_site_relations($source_site_id)) {
         $this->content_relations->duplicate_relations($source_site_id, $destination_site_id);
         return;
     }
     $this->content_relations->relate_all_posts($source_site_id, $destination_site_id);
     $this->content_relations->relate_all_terms($source_site_id, $destination_site_id);
 }