Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress插件返回站点名称_Php_Wordpress_Plugins_Widget - Fatal编程技术网

Php Wordpress插件返回站点名称

Php Wordpress插件返回站点名称,php,wordpress,plugins,widget,Php,Wordpress,Plugins,Widget,在Wordpress中,我尝试使用上述函数检索插件中的站点名称: echo 'You are viewing '.get_current_site()->site_name; echo '<br/>Domain '.get_current_site()->domain; echo '<br/>id '.get_current_site()->id ; echo '<br/>path '.get_current_site()->path

在Wordpress中,我尝试使用上述函数检索插件中的站点名称:

echo 'You are viewing '.get_current_site()->site_name;
echo '<br/>Domain '.get_current_site()->domain;
echo '<br/>id  '.get_current_site()->id ;
echo '<br/>path '.get_current_site()->path;
echo“您正在查看”。获取当前站点()->站点名称;
回显“
域”。获取当前站点()->域; 回显“
id”。获取当前站点()->id; 回显“
路径”。获取当前站点()->路径;

不幸的是,这是从顶级网站返回的信息,而不是我想要的插件所在的子网站。

我想你可以用以下方法来完成:


获取博客信息(“名称”)

注意:我在上面做了一个strtolower,将其传递到我正在构建的url中。