• Hi Josh!

    Thanks so much for a great plugin and Merry Christmas!

    But I found one small flaw. If assign the colors not in a default sequence but selectively ( for example 2 and 4), then the output array of color settings in HTML will be incorrect.

    Original code (flurry.php, rows 740-751):

    	// Set array of colors
    	if (
    		isset( $options['color'] ) ||
    		isset( $options['color2'] ) ||
    		isset( $options['color3'] ) ||
    		isset( $options['color4'] )
    	) {
    		$options['color'] = array_filter( array( $options['color'], $options['color2'], $options['color3'], $options['color4'] ) );
    		unset( $options['color2'] );
    		unset( $options['color3'] );
    		unset( $options['color4'] );
    	}

    HTML output:

    "color":{"1":"#ffffdd","3":"#ffffdd"}

    The js script don’t accept this color settings and the flakes are black. I think it’s better to assign unassigned colors to white by default, then the output of the colors settings will be correct always.

    	// Set array of colors
    	if (
    		isset( $options['color'] ) ||
    		isset( $options['color2'] ) ||
    		isset( $options['color3'] ) ||
    		isset( $options['color4'] )
    	) {
    		if ( is_null( $options['color'] ) ) {
    			$options['color'] = '#ffffff';
    		}
    		if ( is_null( $options['color2'] ) ) {
    			$options['color2'] = '#ffffff';
    		}
    		if ( is_null( $options['color3'] ) ) {
    			$options['color3'] = '#ffffff';
    		}
    		if ( is_null( $options['color4'] ) ) {
    			$options['color4'] = '#ffffff';
    		}
    		$options['color'] = array( $options['color'], $options['color2'], $options['color3'], $options['color4'] );
    		unset( $options['color2'] );
    		unset( $options['color3'] );
    		unset( $options['color4'] );
    	}

    HTML output:

    "color":["#ffffff","#ffffdd","#ffffff","#ffffdd"]

    Best regards sincerely, Dmitriy.

  • The topic ‘The multi color settings’ is closed to new replies.