[Plugin: Simple Tags] Autolink still not working with 2.9.2 (4 posts)

  1. cardnaul
    Posted 6 years ago #

    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!


  2. longjorn
    Posted 6 years ago #

    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);
    		foreach($keys as $key) {
    			$new[$key] = $array[$key];
    		$array = $new;
    		return true;

    no more errors, everything else seems to work like normal

  3. Fernando Tellado
    Posted 6 years ago #

    Works great!


  4. brettbum
    Posted 6 years ago #

    Awesome Longjorn, that worked for me as well. :)

Topic Closed

This topic has been closed to new replies.

About this Topic