• cardnaul

    (@cardnaul)


    On every post I get the following error:

    Warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/status/wp-content/plugins/simple-tags/inc/client.php  on line 1312
    
    Warning: shuffle() expects parameter 1 to be array, null given in /var/www/status/wp-content/plugins/simple-tags/inc/client.php on line 1313
    
    Warning: Invalid argument supplied for foreach() in /var/www/status/wp-content/plugins/simple-tags/inc/client.php on line 1314

    I am using the P2 theme on version 2.9.2.

    I have tried the suggested fix here: https://www.ads-software.com/support/topic/363536
    Unfortunately it does not fix my problem.

    I’ve also tried searching for a fix, to no avail. Please help!

    https://www.ads-software.com/extend/plugins/simple-tags/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I fixed this problem by adding an if statement, if is no array set to an array like this

    /**
    	 * Randomize an array and keep association
    	 *
    	 * @param array $array
    	 * @return boolean
    	 */
    	function randomArray(&$array) {
    // check if is array
    		if(!is_array($array)) {
    		$array = array();
    		}
    // if not array set to array
    	$keys = array_keys($array);
    		shuffle($keys);
    		foreach($keys as $key) {
    			$new[$key] = $array[$key];
    		}
    		$array = $new;
    
    		return true;
    	}

    no more errors, everything else seems to work like normal

    Works great!

    Thanks!

    Awesome Longjorn, that worked for me as well. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Simple Tags] Autolink still not working with 2.9.2’ is closed to new replies.