WordPress:WPMU Functions/get current site

来自站长百科
跳转至: 导航、​ 搜索

This page is [[WordPress::Category:Stubs|marked]] as incomplete. You can help Codex by expanding it.

Returns the following items:

This page is [[WordPress::Category:Stubs|marked]] as incomplete. You can help Codex by expanding it.

返回下面的内容:

 id
 domain
 path
 site_name
 id
 domain
 path
 site_name

Usage[ ]

用法[ ]

To get the blog id, you would use the following code:

你需要使用下面的代码,得到博客id:

$current_site = get_current_site();
echo $current_site->id;

$current_site = get_current_site();

echo $current_site->id;

Or, to do the same, but in only one line:

或者只在一行中,执行同样的操作:

echo get_current_site()->id;

echo get_current_site()->id;

Other[ ]

其它的[ ]

The function as found in footer.php of most Wordpress themes:

函数在WordPress大多数主题的footer.php中:

<?php $current_site = get_current_site(); ?>

<?php $current_site = get_current_site(); ?>

Need content to help solve the following PHP fatal error:

需要内容帮助解决下面的PHP严重错误:

Fatal error: Call to undefined function get_current_site() in /blah/www.mysite.com/wp-content/themes/blah/footer.php on line 2

严重错误:调用/blah/www.mysite.com/wp-content/themes/blah/footer.php第二行中的未定义的函数