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.
예제 #1
0
 /**
  * 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);
 }