WordPress: Template Tags/get bookmarks:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == Description == This function will be found in WordPress v2.1, it is NOT supported by WordPress v2.0. get_bookmarks() returns an array of bookmarks found in the [[WordPress:Administrati...)
 
无编辑摘要
 
第1行: 第1行:
== Description ==
== Description ==
== 描述 ==
This function will be found in WordPress v2.1, it is NOT supported by WordPress v2.0. get_bookmarks() returns an array of bookmarks found in the [[WordPress:Administration_Panels|Administration]] > [[WordPress:Administration_Panels#Manage_Blogroll|Blogroll]] > [[WordPress:Manage_Blogroll_SubPanel|Manage Blogroll]] panel.  This [[WordPress:Template_Tags|Template Tag]] allows the user to retrieve the bookmark information directly.
This function will be found in WordPress v2.1, it is NOT supported by WordPress v2.0. get_bookmarks() returns an array of bookmarks found in the [[WordPress:Administration_Panels|Administration]] > [[WordPress:Administration_Panels#Manage_Blogroll|Blogroll]] > [[WordPress:Manage_Blogroll_SubPanel|Manage Blogroll]] panel.  This [[WordPress:Template_Tags|Template Tag]] allows the user to retrieve the bookmark information directly.
这个函数可以在WordPress2.1版本中找到,WordPress2.0不支持这个函数。get_bookmarks()返回了一组bookmarks,这组bookmarks是从显示[[WordPress:Administration_Panels|管理]] > [[WordPress:Administration_Panels#Manage_Blogroll|友情链接]] > [[WordPress:Manage_Blogroll_SubPanel|管理友情链接]]面板中找到的。这个[WordPress:Template_Tags|模板标签]]能够使用户直接得到bookmark信息。


== Usage ==
== Usage ==
== 用法 ==
%%% <?php get_bookmarks('arguments'); ?> %%%
%%% <?php get_bookmarks('arguments'); ?> %%%
%%% <?php get_bookmarks('arguments'); ?> %%%


第8行: 第16行:


===Default Usage===
===Default Usage===
==例子 ==
===默认用法===
<pre>
'orderby' => 'name',
'order' => 'ASC',
'limit' => -1,
'category' => '',
'category_name' => '',
'hide_invisible' => 1,
'show_updated' => 0,
'include' => '',
'exclude' => ''
</pre>
<pre>
<pre>
'orderby' => 'name',  
'orderby' => 'name',  
第21行: 第49行:


By default, the usage gets:
By default, the usage gets:
默认情况下,用法得到:
* All bookmarks ordered by name, ascending
* All bookmarks ordered by name, ascending
*所有的bookmarks根据名称,按升序排列
* Bookmarks marked as hidden are not returned.
* Bookmarks marked as hidden are not returned.
*标记为隐藏的Bookmarks不会返回。
* The link_updated_f field (the update time in the form of a timestamp) is not returned.
* The link_updated_f field (the update time in the form of a timestamp) is not returned.
* The link_updated_f field(以时间戳形式出现的更新时间)不会返回。


== Parameters ==
== Parameters ==
== 参数 ==
; orderby : (''string'') Value to sort bookmarks on. Defaults to <tt>'name'</tt> unless you pass the value of <tt>&#39;&#39;</tt> (empty), in which case it sets to <tt>'id'</tt>. Valid options:
; orderby : (''string'') Value to sort bookmarks on. Defaults to <tt>'name'</tt> unless you pass the value of <tt>&#39;&#39;</tt> (empty), in which case it sets to <tt>'id'</tt>. Valid options:
; orderby : (''string'')给bookmark分类的参数。默认为<tt>'名称'</tt>,除非你验证通过了参数<tt>&#39;&#39;</tt> (空的),在这种情况下,设置为<tt>'id'</tt>。有效的选项:
:* <tt>'id'</tt>
:* <tt>'id'</tt>
:* <tt>'url'</tt>
:* <tt>'url'</tt>
第40行: 第83行:
:* <tt>'length'</tt> - The length of the bookmark name, shortest to longest.   
:* <tt>'length'</tt> - The length of the bookmark name, shortest to longest.   
:* <tt>'rand'</tt> - Display bookmarks in random order.   
:* <tt>'rand'</tt> - Display bookmarks in random order.   
:* <tt>'id'</tt>
:* <tt>'url'</tt>
:* <tt>'名称'</tt>
:* <tt>'目标'</tt>
:* <tt>'描述'</tt>
:* <tt>'用户'</tt> - 通过bookmarks管理器添加bookmark的用户
:* <tt>'等级级别'</tt>
:* <tt>'更新的'</tt>
:* <tt>'rel'</tt> - bookmark关系 (XFN).
:* <tt>'注意'</tt>
:* <tt>'rss'</tt>
:* <tt>'长度'</tt> - bookmark名称的长度,从最短到最长。
:* <tt>'rand'</tt> -以任意的顺序显示bookmarks。 
; order : (''string'') Sort order, ascending or descending for the orderby parameter. Valid values:
; order : (''string'') Sort order, ascending or descending for the orderby parameter. Valid values:
;顺序:(''string'')分类顺序,根据参数的升序或者降序。有效的参数值:
:* <tt>ASC</tt> (Default)
:* <tt>ASC</tt> (Default)
:* <tt>DESC</tt>
:* <tt>DESC</tt>
:* <tt>ASC</tt> (默认)
:* <tt>DESC</tt>
; limit : (''integer'') Maximum number of bookmarks to display. Defaults to <tt>-1</tt> (all bookmarks).
; limit : (''integer'') Maximum number of bookmarks to display. Defaults to <tt>-1</tt> (all bookmarks).
;限制:(''整数'')最多显示的bookmarks的数目。默认为<tt>-1</tt>(所有的bookmarks)。
; category : (''string'') Comma separated list of bookmark category ID's.
; category : (''string'') Comma separated list of bookmark category ID's.
; 类别 : (''string'')用逗号分开列表上bookmark类别的ID。
; category_name : (''string'') Category name of a catgeory of bookmarks to retrieve. Overrides category parameter.
; category_name : (''string'') Category name of a catgeory of bookmarks to retrieve. Overrides category parameter.
; category_name : (''string'')需要返回的bookmark的类别名称。撤除了类别参数。
; hide_invisible : (''boolean'') TRUE causes only bookmarks with link_visible set to 'Y' to be retrieved.
; hide_invisible : (''boolean'') TRUE causes only bookmarks with link_visible set to 'Y' to be retrieved.
; hide_invisible : (''boolean'')正确的,导致拥有link_visible设置为'Y'的bookmarks返回。
:* <tt>1</tt> (True - default)
:* <tt>1</tt> (True - default)
:* <tt>0</tt> (False)
:* <tt>0</tt> (False)
:* <tt>1</tt> (正确的 – 默认)
:* <tt>0</tt> (错误的)
; show_updated : (''boolean'') TRUE causes an extra column called "link_category_f" to be inserted into the results, which contains the same value as "link_updated", but in a unix timestamp format. Handy for using PHP date functions on this data.
; show_updated : (''boolean'') TRUE causes an extra column called "link_category_f" to be inserted into the results, which contains the same value as "link_updated", but in a unix timestamp format. Handy for using PHP date functions on this data.
; show_updated : (''boolean')TRUE导致了一个额外的,称为"link_category_f"的栏,插入了结果中,结果包含了与"link_updated"相同的值,但是是以unix时间戳的格式。在这个数据上使用PHP日期函数非常方便。
:* <tt>1</tt> (True)
:* <tt>1</tt> (True)
:* <tt>0</tt> (False - default)
:* <tt>0</tt> (False - default)
:* <tt>1</tt> (正确的)
:* <tt>0</tt> (错误的 – 默认)
; include : (''string'') Comma separated list of numeric bookmark IDs to include in the output.  For example, 'include=1,3,6' means to return or echo bookmark IDs 1, 3, and 6.  If the include string is used, the ''category'', ''category_name'', and ''exclude'' parameters are ignored.  Defaults to <tt>''</tt> (all Bookmarks).
; include : (''string'') Comma separated list of numeric bookmark IDs to include in the output.  For example, 'include=1,3,6' means to return or echo bookmark IDs 1, 3, and 6.  If the include string is used, the ''category'', ''category_name'', and ''exclude'' parameters are ignored.  Defaults to <tt>''</tt> (all Bookmarks).
; 包含 : (''string'')用逗号分开列表上的bookmark的ID数字,并且将其包含在输出中。例如,, '包含=1,3,6'指的是返回或者echo bookmark ID1,3,和6。如果使用了包含字符串,便忽视了''类别'', ''category_name'', 和 ''删除''参数。默认为<tt>''</tt>(所有的Bookmarks)。
; exclude : (''string'') Comma separated list of numeric bookmark IDs to exclude.  For example, 'exclude=4,12' means that bookmark IDs 4 and 12 will NOT be returned or echoed.  Defaults to <tt>''</tt> (exclude nothing).
; exclude : (''string'') Comma separated list of numeric bookmark IDs to exclude.  For example, 'exclude=4,12' means that bookmark IDs 4 and 12 will NOT be returned or echoed.  Defaults to <tt>''</tt> (exclude nothing).
; 删除 : (''string'')删除列表上用逗号分开的bookmark ID 数字。例如,'删除=4,12'指的是bookmark ID 为4和12的bookmark不会返回或者echod。默认为<tt>''</tt>(不删除任何内容)。


== Related ==
== Related ==
第60行: 第164行:


{{PHP Function Tag Footer}}
{{PHP Function Tag Footer}}
== 相关的==
{{标签bookmark管理器标签}}
{{PHP函数标签页底文字}}

2008年7月9日 (三) 11:42的最新版本

Description[ ]

描述[ ]

This function will be found in WordPress v2.1, it is NOT supported by WordPress v2.0. get_bookmarks() returns an array of bookmarks found in the Administration > Blogroll > Manage Blogroll panel. This Template Tag allows the user to retrieve the bookmark information directly.

这个函数可以在WordPress2.1版本中找到,WordPress2.0不支持这个函数。get_bookmarks()返回了一组bookmarks,这组bookmarks是从显示管理 > 友情链接 > 管理友情链接面板中找到的。这个[WordPress:Template_Tags|模板标签]]能够使用户直接得到bookmark信息。

Usage[ ]

用法[ ]

%%% <?php get_bookmarks('arguments'); ?> %%%

%%% <?php get_bookmarks('arguments'); ?> %%%

Examples[ ]

Default Usage[ ]

例子[ ]

默认用法[ ]

'orderby' => 'name', 
'order' => 'ASC',
'limit' => -1, 
'category' => '',
'category_name' => '', 
'hide_invisible' => 1,
'show_updated' => 0, 
'include' => '',
'exclude' => ''


'orderby' => 'name', 
'order' => 'ASC',
'limit' => -1, 
'category' => '',
'category_name' => '', 
'hide_invisible' => 1,
'show_updated' => 0, 
'include' => '',
'exclude' => ''

By default, the usage gets: 默认情况下,用法得到:

  • All bookmarks ordered by name, ascending
  • 所有的bookmarks根据名称,按升序排列
  • Bookmarks marked as hidden are not returned.
  • 标记为隐藏的Bookmarks不会返回。
  • The link_updated_f field (the update time in the form of a timestamp) is not returned.
  • The link_updated_f field(以时间戳形式出现的更新时间)不会返回。

Parameters[ ]

参数[ ]

orderby
(string) Value to sort bookmarks on. Defaults to 'name' unless you pass the value of '' (empty), in which case it sets to 'id'. Valid options:


orderby
(string)给bookmark分类的参数。默认为'名称',除非你验证通过了参数'' (空的),在这种情况下,设置为'id'。有效的选项:


  • 'id'
  • 'url'
  • 'name'
  • 'target'
  • 'description'
  • 'owner' - User who added bookmark through bookmarks Manager.
  • 'rating'
  • 'updated'
  • 'rel' - bookmark relationship (XFN).
  • 'notes'
  • 'rss'
  • 'length' - The length of the bookmark name, shortest to longest.
  • 'rand' - Display bookmarks in random order.


  • 'id'
  • 'url'
  • '名称'
  • '目标'
  • '描述'
  • '用户' - 通过bookmarks管理器添加bookmark的用户
  • '等级级别'
  • '更新的'
  • 'rel' - bookmark关系 (XFN).
  • '注意'
  • 'rss'
  • '长度' - bookmark名称的长度,从最短到最长。
  • 'rand' -以任意的顺序显示bookmarks。


order
(string) Sort order, ascending or descending for the orderby parameter. Valid values:


;顺序:(string)分类顺序,根据参数的升序或者降序。有效的参数值:


  • ASC (Default)
  • DESC


  • ASC (默认)
  • DESC


limit
(integer) Maximum number of bookmarks to display. Defaults to -1 (all bookmarks).

;限制:(整数)最多显示的bookmarks的数目。默认为-1(所有的bookmarks)。


category
(string) Comma separated list of bookmark category ID's.
类别
(string)用逗号分开列表上bookmark类别的ID。
category_name
(string) Category name of a catgeory of bookmarks to retrieve. Overrides category parameter.
category_name
(string)需要返回的bookmark的类别名称。撤除了类别参数。
hide_invisible
(boolean) TRUE causes only bookmarks with link_visible set to 'Y' to be retrieved.
hide_invisible
(boolean)正确的,导致拥有link_visible设置为'Y'的bookmarks返回。
  • 1 (True - default)
  • 0 (False)


  • 1 (正确的 – 默认)
  • 0 (错误的)
show_updated
(boolean) TRUE causes an extra column called "link_category_f" to be inserted into the results, which contains the same value as "link_updated", but in a unix timestamp format. Handy for using PHP date functions on this data.
show_updated
(boolean')TRUE导致了一个额外的,称为"link_category_f"的栏,插入了结果中,结果包含了与"link_updated"相同的值,但是是以unix时间戳的格式。在这个数据上使用PHP日期函数非常方便。
  • 1 (True)
  • 0 (False - default)
  • 1 (正确的)
  • 0 (错误的 – 默认)
include
(string) Comma separated list of numeric bookmark IDs to include in the output. For example, 'include=1,3,6' means to return or echo bookmark IDs 1, 3, and 6. If the include string is used, the category, category_name, and exclude parameters are ignored. Defaults to (all Bookmarks).
包含
(string)用逗号分开列表上的bookmark的ID数字,并且将其包含在输出中。例如,, '包含=1,3,6'指的是返回或者echo bookmark ID1,3,和6。如果使用了包含字符串,便忽视了类别, category_name, 和 删除参数。默认为(所有的Bookmarks)。
exclude
(string) Comma separated list of numeric bookmark IDs to exclude. For example, 'exclude=4,12' means that bookmark IDs 4 and 12 will NOT be returned or echoed. Defaults to (exclude nothing).
删除
(string)删除列表上用逗号分开的bookmark ID 数字。例如,'删除=4,12'指的是bookmark ID 为4和12的bookmark不会返回或者echod。默认为(不删除任何内容)。

Related[ ]

模板:Tag bookmark Manager Tags

模板:PHP Function Tag Footer


相关的[ ]

模板:标签bookmark管理器标签