/**
  * Registers columns for the list table on the Sites page in the Network Admin.
  *
  * @return void
  */
 private function register_sites_list_table_columns()
 {
     (new SitesListTableColumn('multilingualpress.relationships', __('Relationships', 'multilingual-press'), function ($id, $site_id) {
         switch_to_blog($site_id);
         $sites = \Inpsyde\MultilingualPress\get_available_language_names();
         restore_current_blog();
         unset($sites[$site_id]);
         return $sites ? '<div class="mlp_interlinked_blogs">' . join('<br>', array_map('esc_html', $sites)) . '</div>' : __('none', 'multilingual-press');
     }))->register();
     (new SitesListTableColumn('multilingualpress.site_language', __('Site Language', 'multilingual-press'), function ($id, $site_id) {
         $language = \Inpsyde\MultilingualPress\get_site_language($site_id);
         return '' === $language ? __('none', 'multilingual-press') : sprintf('<div class="mlp_site_language">%s</div>', esc_html(\Inpsyde\MultilingualPress\get_language_by_http_name(str_replace('_', '-', $language))));
     }))->register();
 }
 /**
  * Return the available site languages.
  *
  * @return array
  */
 public function get_site_languages()
 {
     $languages = \Inpsyde\MultilingualPress\get_available_language_names();
     unset($languages[get_current_blog_id()]);
     return $languages;
 }
 /**
  * AJAX handler.
  *
  * Called by the view. The 'exit' is handled there.
  *
  * @return array
  */
 public function get_ajax_menu_items()
 {
     if (!$this->is_allowed()) {
         return [];
     }
     $titles = \Inpsyde\MultilingualPress\get_available_language_names();
     return $this->prepare_menu_items($titles);
 }