[PATCH] Invalid argument in fields.php
-
With WP_DEBUG on I’m getting a couple of warnings on my WP admin dashboard.
Warning: Invalid argument supplied for foreach() in /path/to/wp-content/plugins/types/embedded/includes/fields.php on line 76
This is the line in question:
foreach ( $fields as $k => $v ) {
I did a
var_dump($fields)
and it looks like afalse
boolean was being passed. Simple fix is to add the line:if ( is_array($fields) )
above the foreach.
Second was:
Warning: Invalid argument supplied for foreach() in /path/to/wp-content/plugins/types/embedded/classes/conditional.php on line 82
which is
foreach ( $fields->fields->all as $f_id => $f ) {
Again, all is a false boolean so I added
if ( is_array($fields->fields->all) )
above the foreach.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[PATCH] Invalid argument in fields.php’ is closed to new replies.