函数文档

get_linksbyname_withrating()

💡 云策文档标注

概述

get_linksbyname_withrating() 是一个已弃用的 WordPress 函数,用于获取指定分类的链接并显示评分星号或字符。开发者应改用 get_bookmarks() 函数。

关键要点

  • 函数已弃用:自 WordPress 2.1.0 起,推荐使用 get_bookmarks() 替代。
  • 功能:获取与指定分类名关联的链接,并支持显示评分信息。
  • 参数:包括 $cat_name(分类名)、$before(链接前 HTML)、$after(链接后 HTML)、$between(链接与描述间 HTML)、$show_images(是否显示图片)、$orderby(排序方式)、$show_description(是否显示描述)、$limit(限制条目数)、$show_updated(是否显示更新时间戳)。
  • 默认值:如 $cat_name 默认为 'noname',$limit 默认为 -1(显示所有条目)。

注意事项

  • 此函数已标记为弃用,使用时会触发 _deprecated_function() 警告。
  • 排序参数 $orderby 支持 'id'、'name'、'url'、'description'、'rating'、'owner' 等值,前缀下划线可反转顺序,'rand' 用于随机排序。

📄 原文内容

Gets the links associated with category ‘cat_name’ and display rating stars/chars.

Description

See also

Parameters

$cat_namestringoptional
The category name to use. If no match is found, uses all.
Default 'noname'.
$beforestringoptional
The HTML to output before the link. Default empty.
$afterstringoptional
The HTML to output after the link. Default <br />.
$betweenstringoptional
The HTML to output between the link/image and its description.
Not used if no image or $show_images is true. Default ‘ ‘.
$show_imagesbooloptional
Whether to show images (if defined).

Default:true

$orderbystringoptional
The order to output the links. E.g. 'id', 'name', 'url', 'description', 'rating', or 'owner'. Default 'id'.
If you start the name with an underscore, the order will be reversed.
Specifying 'rand' as the order will return links in a random order.
$show_descriptionbooloptional
Whether to show the description if show_images=false/not defined.

Default:true

$limitintoptional
Limit to X entries. If not specified, all entries are shown.

Default:-1

$show_updatedintoptional
Whether to show last updated timestamp. Default 0.

Source

function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ",
									$show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );

	get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
}

Changelog

Version Description
2.1.0 Deprecated. Use get_bookmarks()
0.71 Introduced.