函数原型
get_linkobjects( int $category, string $orderby = ‘name’, int $limit ): array
函数描述
Gets an array of link objects associated with category n.
是否弃用
Warning: This function has been deprecated. Use get_bookmarks() instead.
函数参数
-
$category
int
Optional - The category to use. If no category supplied, uses all.
Default 0. -
$orderby
string
Optional - The order to output the links. E.g.
'id','name','url','description','rating', or'owner'. Default'name'.
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.Default:
'name' -
$limit
int
Optional - Limit to X entries. If not specified, all entries are shown.
Default 0.
函数返回值
array
函数位置
File: wp-includes/deprecated.php.
函数源码
$links = get_linkobjects(1);
if ($links) {
foreach ($links as $link) {
echo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>';
}
}源码链接
变更日志
| Version | Description |
|---|---|
| 2.1.0 | Use get_bookmarks() |
| 1.0.1 | Introduced. |

