get_editable_authors() - WordPress 函数参考中文文档

返回介绍

get_editable_authors()

发布于 2017-09-10 字数1624 浏览 756 评论 0

Warning: This function has been deprecated. Use get_users() instead.

get_editable_authors( int $user_id )

Gets author users who can edit posts.


描述


参数

$user_id

(int)
(Required)
User ID.


返回值

(array|bool) List of editable authors. False if no editable users.


源代码

File: wp-admin/includes/deprecated.php

function get_editable_authors( $user_id ) {
	_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );

	global $wpdb;

	$editable = get_editable_user_ids( $user_id );

	if ( !$editable ) {
		return false;
	} else {
		$editable = join(',', $editable);
		$authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
	}

	return apply_filters('get_editable_authors', $authors);
}

更新日志

Version 描述
3.1.0 Introduced.

相关函数

Uses

  • wp-admin/includes/deprecated.php:
    get_editable_user_ids()
  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/wp-db.php:
    wpdb::get_results()

User Contributed Notes

上一篇:get_dropins()

下一篇:get_editable_roles()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!