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

get_editable_authors() WordPress Function

The get_editable_authors() function allows you to get a list of all the users who can edit a particular post. This is useful if you want to limit who can edit a post to only certain users.

get_editable_authors( int $user_id ) #

Gets author users who can edit posts.


Parameters

$user_id

(int)(Required)User ID.


Top ↑

Return

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


Top ↑

Source

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);
}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More