• Resolved Cliff

    (@ckct)


    I recenlty updated to version 1.5.2 and I am getting the following error:

    Warning: Invalid argument supplied for foreach() in /home/content/25/8265325/html/wp-content/plugins/ad-inserter/ad-inserter.php on line 225

    Line 225 = foreach ($sidebar_widget as $widget) {

    foreach ($sidebar_widgets as $sidebar_widget_index => $sidebar_widget) {
        foreach ($sidebar_widget as $widget) {
          if (preg_match ("/ai_widget([\d]+)/", $widget)) {
            $sidebars_with_deprecated_widgets [$sidebar_widget_index] = $GLOBALS ['wp_registered_sidebars'][$sidebar_widget_index]['name'];
          }
        }
      }

    What should I do to fix this?

    Thanks!
    Cliff

    https://www.ads-software.com/plugins/ad-inserter/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Spacetime

    (@spacetime)

    Please try this code instead teh code above:

    foreach ($sidebar_widgets as $sidebar_widget_index => $sidebar_widget) {
        if (is_array ($sidebar_widget))
          foreach ($sidebar_widget as $widget) {
            if (preg_match ("/ai_widget([\d]+)/", $widget)) {
              $sidebars_with_deprecated_widgets [$sidebar_widget_index] = $GLOBALS ['wp_registered_sidebars'][$sidebar_widget_index]['name'];
            }
          }
      }
    Thread Starter Cliff

    (@ckct)

    Thank you.

    It fixed the problem!

    Plugin Author Spacetime

    (@spacetime)

    Great!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Invalid argument supplied for foreach() …in line 225’ is closed to new replies.