| @@ -32,14 +32,14 @@ | ||
| 32 | 32 | |
| 33 | 33 | return acym_rootURI(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -function acym_rootURI(bool $pathonly = false, ?string $path = 'siteurl'): string | |
| 36 | +function acym_rootURI(bool $pathonly = false, ?string $path = 'siteurl', bool $skipMultilingual = false): string | |
| 37 | 37 | { |
| 38 | - $rootURI = rtrim(site_url(), '/').'/'; | |
| 38 | + $rootURI = rtrim($skipMultilingual ? get_option('siteurl') : site_url(), '/').'/'; | |
| 39 | 39 | |
| 40 | 40 | // For WPML |
| 41 | - if (!acym_isAdmin()) { | |
| 41 | + if (!$skipMultilingual && !acym_isAdmin()) { | |
| 42 | 42 | // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- WPML hook for integration. |
| 43 | 43 | $wpmlSiteUrl = apply_filters('wpml_home_url', $rootURI); |
| 44 | 44 | if ($wpmlSiteUrl !== $rootURI) { |
| 45 | 45 | $rootURI = rtrim($wpmlSiteUrl, '/').'/'; |
| @@ -74,9 +74,9 @@ | ||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | function acym_frontendLink(string $link, bool $complete = true, bool $sef = true): string |
| 77 | 77 | { |
| 78 | - return acym_rootURI().acym_addPageParam($link, true, true); | |
| 78 | + return acym_rootURI(false, 'siteurl', true).acym_addPageParam($link, true, true); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | function acym_backendLink(string $link): string |
| 82 | 82 | { |