get_editable_authors

Gets author users who can edit posts.

Description

(array|bool) get_editable_authors( (int) $user_id ); 

Returns (array|bool)

List of editable authors. False if no editable users.

Parameters (1)

0. $user_id (int)
The user id.

Usage

  1. if ( !function_exists( 'get_editable_authors' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/deprecated.php'; 
  3.  
  4. // The user id. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_editable_authors($user_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/deprecated.php  
  1. function get_editable_authors( $user_id ) { 
  2. _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' ); 
  3.  
  4. global $wpdb; 
  5.  
  6. $editable = get_editable_user_ids( $user_id ); 
  7.  
  8. if ( !$editable ) { 
  9. return false; 
  10. } else { 
  11. $editable = join(', ', $editable); 
  12. $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" ); 
  13.