$value ) { $palettes[$i][$key] = Kirki_Color::sanitize_hex( $value ); } $i++; } return $palettes; } /** * Get the palettes from an XML file and parse them. * * @param string|null $xml */ public static function parse( $xml = null ) { /** * Parse the XML file. * XML copied from http://www.colourlovers.com/api/palettes/top?numResults=100 */ $xml_url = ( is_null( $xml ) ) ? trailingslashit( Kirki::$url ) . 'assets/xml/colourlovers-top.xml' : $xml; $feed_xml = simplexml_load_file( $xml_url ); $palettes = array(); foreach ( $feed_xml->palette as $result ) { $palettes[] = (array) $result->colors->hex; } return $palettes; } } }