Conversation
supportHi, 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?
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
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 This reply was modified 9 years, 3 months ago by Jamie Burchell . This reply was modified 9 years, 3 months ago by Jamie Burchell .
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; } } This reply was modified 9 years, 3 months ago by Jamie Burchell .
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
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 This reply was modified 9 years, 3 months ago by Jamie Burchell . This reply was modified 9 years, 3 months ago by Jamie Burchell .
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; } } This reply was modified 9 years, 3 months ago by Jamie Burchell .