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

返回介绍

get_author_user_ids()

发布于 2017-09-10 字数1473 浏览 945 评论 0

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

get_author_user_ids()

Get all user IDs.


描述


返回值

(array) List of user IDs.


源代码

File: wp-admin/includes/deprecated.php

function get_author_user_ids() {
	_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );

	global $wpdb;
	if ( !is_multisite() )
		$level_key = $wpdb->get_blog_prefix() . 'user_level';
	else
		$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels

	return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
}

更新日志

Version 描述
3.1.0 Introduced.

相关函数

Uses

  • wp-includes/load.php:
    is_multisite()
  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/wp-db.php:
    wpdb::get_col()
  • wp-includes/wp-db.php:
    wpdb::prepare()
  • wp-includes/wp-db.php:
    wpdb::get_blog_prefix()

User Contributed Notes

上一篇:get_author_template()

下一篇:get_autotoggle()

发布评论

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

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