HEX
Server: Apache/2
System: Linux bq-e705.pointdnshere.com 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User: wellmix (1103)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/wellmix/public_html/wp-content/plugins/weglot/src/services/class-multisite-service-weglot.php
<?php

namespace WeglotWP\Services;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}


/**
 * Multisite service
 *
 * @since 2.0
 */
class Multisite_Service_Weglot {
	/**
	 * @var Request_Url_Service_Weglot
	 */
	private $request_url_services;

	/**
	 * @since 2.0
	 */
	public function __construct() {
		$this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
	}

	/**
	 * @since 2.0
	 *
	 * @return array
	 */
	public function get_list_of_network_path() {
		$paths = array();

		if ( is_multisite() ) {
			$sites = \get_sites(
				array(
					'number' => 0,
				)
			);

			foreach ( $sites as $site ) {
				$path = $site->path;
				array_push( $paths, $path );
			}
		} else {
			array_push( $paths, $this->request_url_services->get_home_wordpress_directory() );
		}

		return $paths;
	}
}