/** * create $td_authors array in format id_author => display_name_author * @return array id_author => display_name_author */ static function create_array_authors() { if (is_admin()) { //return the cache if available if (self::$authors_array_cache != '') { return self::$authors_array_cache; } $td_authors = array(); $td_return_obj_authors = get_users('role=Administrator'); $td_authors[' - No author filter - '] = ''; foreach ($td_return_obj_authors as $obj_autor) { $auth_id = $obj_autor->ID; $auth_name = $obj_autor->display_name; $td_authors[$auth_name] = $auth_id; } self::$authors_array_cache = $td_authors; //print_r($td_authors); return $td_authors; } }