Support » Plugin: Authors Widget » 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

    (@flocsy)

    It looks like you’re trying to exclude an non-existant user ID. Try to remove it from the “exclude” field

    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

    (@flocsy)

    Try version 2.4.5, it should fix this problem

    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

    Any update on this? Thanks 🙂

    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;
    		}
    	}
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Non object Error’ is closed to new replies.