On this page
get_editable_authors( int $user_id ): array|false
This function has been deprecated. Use get_users() instead.
Gets author users who can edit posts.
Parameters
$user_idint Required-
User ID.
Return
array|false List of editable authors. False if no editable users.
Source
File: wp-admin/includes/deprecated.php. View all references
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);
}
Related
Uses
| Uses | Description |
|---|---|
| get_editable_user_ids() wp-admin/includes/deprecated.php | Gets the IDs of any users who can edit posts. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| wpdb::get_results() wp-includes/class-wpdb.php | Retrieves an entire SQL result set from the database (i.e., many rows). |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_editable_authors