• After I updated WP 4.7, following error has happened.

    Warning: Invalid argument supplied for foreach() in
    ***/htdocs/wp-content/plugins/head-cleaner/head-cleaner.php on line 2895

    Thank you for this plugin support.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I am also getting this, help!!!!

    I got this problem, but I could solve it.

    You edit the code file “plugins/head-cleaner/head-cleaner.php” as follow. It’s near line 2895.

    (Sorry, my English is not well…)

    [original]

    foreach ($active_filters as $priority => $filters) {
    	if (!is_array($filters)) {
    		continue;
    	}
    	foreach ($filters as $filter) {
    		$function_name = $this->_get_function_name($filter['function']);
    		if ( $this->function_enabled($function_name) ) {
    			if (!isset($this->filters[$tag]))
    				$this->filters[$tag] = array();
    			$this->filters[$tag][$function_name] = $priority;
    		}
    	}
    }

    [fixed]

    foreach ($active_filters as $priority => $filters) {
    	// Added code from here.
    	if (!is_array($filters)) {
    		continue;
    	}
    	// over.
    	foreach ($filters as $filter) {
    		$function_name = $this->_get_function_name($filter['function']);
    		if ( $this->function_enabled($function_name) ) {
    			if (!isset($this->filters[$tag]))
    				$this->filters[$tag] = array();
    			$this->filters[$tag][$function_name] = $priority;
    		}
    	}
    }

    It is nonsense to modify the program in the plugins folder.
    Are you going to fix it whenever an update comes up?

    I think so. it is only temporaly fix.
    This problem should be fixed by plugins update.

    • This reply was modified 7 years, 11 months ago by iorin0225.

    I have the same error on all my sites with WordPress 4.7!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Invalid argument Error at WP4.7’ is closed to new replies.