) ) { $home_root = '/' . trim( $home_root['path'], '/' ); $home_root = rtrim( $home_root, '/' ); } else { $home_root = ''; } return $home_root; } /** * Get the URL of the site's root. It corresponds to the main site's home page URL. * * @since 3.1.1 * @author Grégory Viguier * * @return string */ function rocket_get_main_home_url() { static $root_url; if ( isset( $root_url ) ) { return $root_url; } if ( ! is_multisite() || is_main_site() ) { $root_url = rocket_get_home_url( '/' ); return $root_url; } $current_network = get_network(); if ( $current_network ) { $root_url = set_url_scheme( 'https://' . $current_network->domain . $current_network->path ); $root_url = trailingslashit( $root_url ); } else { $root_url = rocket_get_home_url( '/' ); } return $root_url; }