函数文档

list_authors()

💡 云策文档标注

概述

list_authors() 是一个已弃用的 WordPress 函数,用于列出网站作者,自 2.1.0 版本起被 wp_list_authors() 取代。它接受多个参数来控制输出,并调用 wp_list_authors() 实现功能。

关键要点

  • list_authors() 已弃用,建议使用 wp_list_authors() 替代。
  • 函数接受参数如 optioncount、exclude_admin、show_fullname、hide_empty、feed 和 feed_image,用于自定义作者列表。
  • 返回 null 或字符串,具体取决于输出内容。
  • 相关函数包括 wp_list_authors() 和 _deprecated_function()。

代码示例

function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
    _deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_authors()' );

    $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image');
    return wp_list_authors($args);
}

注意事项

  • 自 WordPress 2.1.0 版本起,此函数已被弃用,开发者应迁移到 wp_list_authors() 以避免兼容性问题。
  • 参数默认值如 exclude_admin 为 true 和 hide_empty 为 true,需根据实际需求调整。

📄 原文内容

Lists authors.

Description

See also

Parameters

$optioncountbooloptional

Default:false

$exclude_adminbooloptional

Default:true

$show_fullnamebooloptional

Default:false

$hide_emptybooloptional

Default:true

$feedstringrequired
$feed_imagestringrequired

Return

null|string

Source

function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_authors()' );

	$args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image');
	return wp_list_authors($args);
}

Changelog

Version Description
2.1.0 Deprecated. Use wp_list_authors()
1.2.0 Introduced.