Php 在Wordpress+中获取所选语言网站的主页;Polylang

Php 在Wordpress+中获取所选语言网站的主页;Polylang,php,wordpress,polylang,Php,Wordpress,Polylang,在我的Wordpress+Polylang网站中,accueil是法语主页的页面名称,inicio是西班牙语主页的页面名称 因此,主页是: English : https://www.example.com French : https://www.example.com/fr/accueil/ Spanish : https://www.example.com/es/inicio/ 是否可以获取所选语言的主页url 我使用home\u url()获取主页 我使用pll\u current\

在我的Wordpress+Polylang网站中,
accueil
是法语主页的页面名称,
inicio
是西班牙语主页的页面名称

因此,主页是:

English : https://www.example.com
French  : https://www.example.com/fr/accueil/
Spanish : https://www.example.com/es/inicio/
是否可以获取所选语言的主页url

我使用
home\u url()
获取主页

我使用
pll\u current\u language()
polylang函数来获取网站所选的polylang语言代码


但是
home\u url()。
它接受一个参数(所需主页的语言)

(string) pll_home_url(  $lang = '' );