WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Simple Tags] Autolink still not working with 2.9.2

[Plugin: Simple Tags] Autolink still not working with 2.9.2

  • 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: http://wordpress.org/support/topic/363536
    Unfortunately it does not fix my problem.

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

    http://wordpress.org/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.
Skip to toolbar