WordPress: Function Reference/get category feed link:修订间差异
来自站长百科
(新页面: ==Description== Released with WordPress:Version 2.5, this function returns a link to the feed for all posts in the specified category. A particular feed can be requested, but if the...) |
无编辑摘要 |
||
第1行: | 第1行: | ||
==Description== | ==Description== | ||
== 描述== | |||
Released with [[WordPress:Version 2.5]], this function returns a link to the feed for all posts in the specified category. A particular feed can be requested, but if the feed parameter is left blank, it returns the 'rss2' feed link. This function replaces the deprecated '''get_category_rss_link''' function. | Released with [[WordPress:Version 2.5]], this function returns a link to the feed for all posts in the specified category. A particular feed can be requested, but if the feed parameter is left blank, it returns the 'rss2' feed link. This function replaces the deprecated '''get_category_rss_link''' function. | ||
这个函数是在[[WordPress:Version 2.5|2.5版本]]时候发行的,为某个类别中的所有文章返回feed的链接。需要一个特别的feed,但是如果feed参数是空白的,返回'rss2' feed链接。这个函数代替了取消的'''get_category_rss_link'''函数。 | |||
== Usage == | == Usage == | ||
== 用法 == | |||
%%% <?php get_category_feed_link('cat_id', 'feed'); ?> %%% | |||
%%% <?php get_category_feed_link('cat_id', 'feed'); ?> %%% | %%% <?php get_category_feed_link('cat_id', 'feed'); ?> %%% | ||
== Examples == | == Examples == | ||
== 例子 == | |||
=== Default Usage === | === Default Usage === | ||
=== 默认用法 === | |||
Return the rss2 feed link for post in category 2 | Return the rss2 feed link for post in category 2 | ||
返回类别2中的文章的rss2 feed链接。 | |||
<pre> <?php get_category_feed_link('2', ''); ?></pre> | |||
<pre> <?php get_category_feed_link('2', ''); ?></pre> | <pre> <?php get_category_feed_link('2', ''); ?></pre> | ||
=== Parameters === | === Parameters === | ||
== 参数 == | |||
; cat_id : (''string'') Category ID of feed link to return. | ; cat_id : (''string'') Category ID of feed link to return. | ||
; cat_id : (''string'')将要返回的feed链接的类别ID。 | |||
; feed : (''string'') Type of feed, if left blank uses, by default, the 'rss2' feed. | ; feed : (''string'') Type of feed, if left blank uses, by default, the 'rss2' feed. | ||
; feed : (''string'')feed的类型,如果是空白的,默认情况下,类型是'rss2' feed。 | |||
==Depreciated Function== | |||
== | ==取消的函数== | ||
get_category_rss_link | |||
get_category_rss_link | get_category_rss_link |
2008年7月21日 (一) 11:32的版本
Description
描述
Released with WordPress:Version 2.5, this function returns a link to the feed for all posts in the specified category. A particular feed can be requested, but if the feed parameter is left blank, it returns the 'rss2' feed link. This function replaces the deprecated get_category_rss_link function.
这个函数是在2.5版本时候发行的,为某个类别中的所有文章返回feed的链接。需要一个特别的feed,但是如果feed参数是空白的,返回'rss2' feed链接。这个函数代替了取消的get_category_rss_link函数。
Usage
用法
%%% <?php get_category_feed_link('cat_id', 'feed'); ?> %%%
%%% <?php get_category_feed_link('cat_id', 'feed'); ?> %%%
Examples
例子
Default Usage
默认用法
Return the rss2 feed link for post in category 2
返回类别2中的文章的rss2 feed链接。
<?php get_category_feed_link('2', ''); ?>
<?php get_category_feed_link('2', ''); ?>
Parameters
参数
- cat_id
- (string) Category ID of feed link to return.
- cat_id
- (string)将要返回的feed链接的类别ID。
- feed
- (string) Type of feed, if left blank uses, by default, the 'rss2' feed.
- feed
- (string)feed的类型,如果是空白的,默认情况下,类型是'rss2' feed。
Depreciated Function
取消的函数
get_category_rss_link get_category_rss_link