• On or around line 315 there a line, foreach(glob($dir.’/’.$template_file) as $file) {

    glob doesn’t always return an array, it can return false on error, which causes a Warning: Invalid argument supplied for foreach() in when using the post loop widget

    I fixed on my version by changing it to :

    $files = glob($dir.'/'.$template_file);
                            if(is_array($files)) {
                                foreach($files as $file) {
                                        $templates[] = str_replace($dir.'/', '', $file);
                                }
                            }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    http://`wordpress.org/plugins/siteorigin-panels/

  • The topic ‘Minor bug in widgets/widgets/basic.php’ is closed to new replies.