I will have a look, but it is a Warning, so it doesn’t hurt. In the meantime, disable WP_DEBUG in your wp-config.php
What version of php and WordPress are you running?
-
This reply was modified 1 year, 7 months ago by fmarzocca.
Be sure that each of your Category has a slug.
Woa! You’re fast!
All categories have a slug (just checked to make sure)
WP: 6.2.2
PHP: 8.1.9
wpconfig: define( ‘WP_DEBUG’, false );
-
This reply was modified 1 year, 7 months ago by josflachs.
Mmmh. I haven’t tried yet with php 8…
Can you pls post the Shortcode you are using to display that page?
This is mine, working:
[ACT-list show="Author" exclude="News" reverse-date=1 postdate=1 ]
Don’t you have unpublished articles, or orphaned/unclassified categories? The error is coming from an invalid category, but this is the first time I see it. Don’t you have the chance to switch to PHP 7.x for a test?
In any case, if WP_DEBUG is false, it must not display that warning.
define('WP_DEBUG', FALSE);
-
This reply was modified 1 year, 7 months ago by fmarzocca.
I switch to the obsolete 7.4 version: that works. 8.02 gave me the error again. So it has something to do with the +8 PHP versions.
The WP_DEBUG is false, but it does show the error nevertheless.
I’m not going live with a site on php 7.4. When do you think the plugin will be upgraded?
-
This reply was modified 1 year, 7 months ago by josflachs.
At the moment I have no plans to update to php 8, but can you pls make a test? Create an empty Category (i.e.: test) and then exclude that category from your shortcode:
[ACT-list show="Author" exclude="test"]
It works!
Thanks Fabio, you’re great.
Can I take advantage of your courtesy?
If you edit the file ACT-displayer.php
in: wp-content/plugins/list-all-posts-by-authors-nested-categories-and-titles/include
go to the very end of the file and replace the function get_cats_by_slug
with this one:
function get_cats_by_slug($catslugs) {
$catids = array();
foreach($catslugs as $slug) {
if (!get_category_by_slug($slug) ) break;
$catids[] = get_category_by_slug($slug)->term_id;
}
return $catids;
}
Then remove the exclude
in the shortcode and let me know if it works. In such a case I will deploy a new version.
Of course, I just did it and it works fine.