Invalid argument supplied for foreach()
-
Your code is missing a check that
$wp_query->posts
is not empty. As a result, a warning is triggered when someone tries to to visit a page that doesn’t exist.The code in question is in the file ‘inc/class-registration.php’ line 315. Currently, this check doesn’t exist, which means an empty value is passed to wp_list_pluck, which generates the error in this post title. Adding a check that there are posts before calling this method will silence these warnings.
Many thanks
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Invalid argument supplied for foreach()’ is closed to new replies.