Title: Non object Error
Last modified: September 10, 2016

---

# Non object Error

 *  [Minh Tuan Nguyen](https://wordpress.org/support/users/minh-tuan-nguyen/)
 * (@minh-tuan-nguyen)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/non-object-error/)
 * Hi,
 * After add the widget. it show like that:
 * Notice: Trying to get property of non-object in /plugins/authors/authors.php 
   on line 538
 * Any help?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [flocsy](https://wordpress.org/support/users/flocsy/)
 * (@flocsy)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/non-object-error/#post-8171057)
 * It looks like you’re trying to exclude an non-existant user ID. Try to remove
   it from the “exclude” field
 *  [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/non-object-error/#post-8730196)
 * I also have this problem and an undefined constant:
 *     ```
       Notice: Trying to get property of non-object in plugins/authors/authors.php on line 538
   
       Notice: Use of undefined constant widget_authors_sort_by_random - assumed 'widget_authors_sort_by_random' in plugins/authors/authors.php on line 69
       ```
   
 * The “exclude” field is empty in the settings, but when I output the value of 
   exclude at line 533 it was “0”.
 * WP v4.7.2
    Plugin v2.4.4
 *  Plugin Author [flocsy](https://wordpress.org/support/users/flocsy/)
 * (@flocsy)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/non-object-error/#post-8742518)
 * Try version 2.4.5, it should fix this problem
 *  [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/non-object-error/#post-8743222)
 * Thank you, that seems to have stopped that error but we still see this:
 * `Notice: Use of undefined constant widget_authors_sort_by_random - assumed 'widget_authors_sort_by_random'
   in plugins/authors/authors.php on line 69`
    -  This reply was modified 9 years, 4 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).
    -  This reply was modified 9 years, 4 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).
 *  [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/non-object-error/#post-8836035)
 * Any update on this? Thanks 🙂
 *  [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/non-object-error/#post-8858386)
 * I think you need to quote the function names as a string like this:
 *     ```
       	function widget_authors_sort_by($orderby, &$authors) {
       #		if ('first_name' != $orderby && 'last_name' != $orderby) {
       #			return;
       #		}
       		switch ($orderby) {
       		case 'first_name':
       			array_walk($authors, 'widget_authors_add_last_name');
       			usort($authors, 'widget_authors_sort_by_first_name');
       			break;
       		case 'last_name':
       			array_walk($authors, 'widget_authors_add_last_name');
       			usort($authors, 'widget_authors_sort_by_last_name');
       			break;
       		case 'id':
       			usort($authors, 'widget_authors_sort_by_id');
       			break;
       		case 'random':
       			usort($authors, 'widget_authors_sort_by_random');
       			break;
       #		case 'posts':
       #			usort($authors, 'widget_authors_sort_by_posts');
       #			break;
       		}
       	}
       ```
   
    -  This reply was modified 9 years, 3 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Non object Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/authors.svg)
 * [Authors Widget](https://wordpress.org/plugins/authors/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/authors/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/authors/)
 * [Active Topics](https://wordpress.org/support/plugin/authors/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/authors/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/authors/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/non-object-error/#post-8858386)
 * Status: not resolved