获取与类别关联的链接。
原型
wp_get_links( string $args = '' )
参数
$args
(string)
(Optional)
查询字符串
返回值
(null|string)
源文件
路径:wp-includes/deprecated.php
<?php
...
function wp_get_links($args = '') {
_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_bookmarks()' );
if ( strpos( $args, '=' ) === false ) {
$cat_id = $args;
$args = add_query_arg( 'category', $cat_id, $args );
}
$defaults = array(
'after' => '<br />',
'before' => '',
'between' => ' ',
'categorize' => 0,
'category' => '',
'echo' => true,
'limit' => -1,
'orderby' => 'name',
'show_description' => true,
'show_images' => true,
'show_rating' => false,
'show_updated' => true,
'title_li' => '',
);
$r = wp_parse_args( $args, $defaults );
return wp_list_bookmarks($r);
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_get_links/