WordPress: WPMU Functions/get current site:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: {{Stub}} Returns the following items: id domain path site_name ==Usage== To get the blog id, you would use the following code: $current_site = get_current_site(); echo $curr...)
 
无编辑摘要
 
第2行: 第2行:


Returns the following items:
Returns the following items:
{{Stub}}
返回下面的内容:
  id
  domain
  path
  site_name


   id
   id
第9行: 第18行:


==Usage==
==Usage==
==用法==


To get the blog id, you would use the following code:
To get the blog id, you would use the following code:
你需要使用下面的代码,得到博客id:
  $current_site = get_current_site();
  $current_site = get_current_site();
echo $current_site->id;
$current_site = get_current_site();
  echo $current_site->id;
  echo $current_site->id;


Or, to do the same, but in only one line:
Or, to do the same, but in only one line:
   
   
或者只在一行中,执行同样的操作:
  echo get_current_site()->id;
  echo get_current_site()->id;
echo get_current_site()->id;


==Other==
==Other==
==其它的==
The function as found in footer.php of most Wordpress themes:
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(); ?>


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


Need content to help solve the following PHP fatal error:
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
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第二行中的未定义的函数

2008年9月26日 (五) 14:52的最新版本

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第二行中的未定义的函数