WordPress函数文档get_bloginfo_rss()
获取博客的RSS相关信息 描述 译文 bloginfo函数的http://en.wikipedia.org/w…
获取博客的RSS相关信息
描述
译文
bloginfo函数的http://en.wikipedia.org/wiki/Rss RSS]集装箱。
可以用 get_bloginfo()函数检索任何想要检索的信息。当函数值在feed中被检索以供使用时,所有值的标签都将被除去,字符也将被转换。
原文
RSS container for the bloginfo function.
You can retrieve anything that you can using the get_bloginfo() function. Everything will be stripped of tags and characters converted, when the values are retrieved for use in the feeds.
用法
<?php get_bloginfo_rss( $show ) ?>
参数
$show
(string) (可选) Informational detail about your blog. Valid values:
默认值: ”
- ‘name’ – Weblog title; set in General Options. (Default)
- ‘description’ – Tagline for your blog; set in General Options.
- ‘url’ – URL for your blog’s web site address.
- ‘rdf_url’ – URL for RDF/RSS 1.0 feed.
- ‘rss_url’ – URL for RSS 0.92 feed.
- ‘rss2_url’ – URL for RSS 2.0 feed.
- ‘atom_url’ – URL for Atom feed.
- ‘comments_rss2_url’ – URL for comments RSS 2.0 feed.
- ‘pingback_url’ – URL for Pingback (XML-RPC file).
- ‘admin_email’ – Administrator’s email address; set in General Options.
- ‘charset’ – Character encoding for your blog; set in Reading Options.
- ‘version’ – Version of WordPress your blog uses.
The following work in WordPress version 1.5 or after:
- ‘html_type’ – “Content-type” for your blog.
- ‘wpurl’ – URL for WordPress installation.
- ‘template_url’ – URL for template in use.
- ‘template_directory’ – URL for template’s directory.
- ‘stylesheet_url’ – URL for primary CSS file.
- ‘stylesheet_directory’ – URL for stylesheet directory.
返回值
(string)
示例
RSS2 URL
Assigns the URL of your blog’s RSS2 feed to the variable $rss2_url.
|
1
2
3
4
|
/* ———————————-
* wordpress函数 kim收集
* ———————————- */
<?php $rss2_url = get_bloginfo_rss(‘rss2_url’); ?>
|
注意
- 使用到: apply_filters() 调用 ‘get_bloginfo_rss‘ hook with two parameters.
历史
添加于 版本: 1.5.1
源文件
get_bloginfo_rss() 函数的代码位于 wp-includes/feed.php.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* ———————————-
* wordpress函数 kim收集
* ———————————- */
/**
* RSS container for the bloginfo function.
*
* You can retrieve anything that you can using the get_bloginfo() function.
* Everything will be stripped of tags and characters converted, when the values
* are retrieved for use in the feeds.
*
* @since 1.5.1
* @see get_bloginfo() For the list of possible values to display.
*
* @param string $show See get_bloginfo() for possible values.
* @return string
*/
function get_bloginfo_rss($show = ”) {
$info = strip_tags(get_bloginfo($show));
/**
* Filter the bloginfo for use in RSS feeds.
*
* @since 2.2.0
*
* @see convert_chars()
* @see get_bloginfo()
*
* @param string $info Converted string value of the blog information.
* @param string $show The type of blog information to retrieve.
*/
return apply_filters( ‘get_bloginfo_rss’, convert_chars( $info ), $show );
}
|
- 原文:http://codex.wordpress.org/Function_Reference/get_bloginfo_rss
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论功能已经关闭!