| @@ -9,780 +9,780 @@ | ||
| 9 | 9 | * @author Roman Ožana <[email protected]> | 
| 10 | 10 | */ | 
| 11 | 11 |  class Emogrifier { | 
| 12 | - /** | |
| 13 | - * @var string | |
| 14 | - */ | |
| 15 | - const ENCODING = 'UTF-8'; | |
| 16 | - | |
| 17 | - /** | |
| 18 | - * @var integer | |
| 19 | - */ | |
| 20 | - const CACHE_KEY_CSS = 0; | |
| 21 | - | |
| 22 | - /** | |
| 23 | - * @var integer | |
| 24 | - */ | |
| 25 | - const CACHE_KEY_SELECTOR = 1; | |
| 26 | - | |
| 27 | - /** | |
| 28 | - * @var integer | |
| 29 | - */ | |
| 30 | - const CACHE_KEY_XPATH = 2; | |
| 31 | - | |
| 32 | - /** | |
| 33 | - * @var integer | |
| 34 | - */ | |
| 35 | - const CACHE_KEY_CSS_DECLARATION_BLOCK = 3; | |
| 36 | - | |
| 37 | - /** | |
| 38 | - * for calculating nth-of-type and nth-child selectors. | |
| 39 | - * | |
| 40 | - * @var integer | |
| 41 | - */ | |
| 42 | - const INDEX = 0; | |
| 43 | - | |
| 44 | - /** | |
| 45 | - * for calculating nth-of-type and nth-child selectors. | |
| 46 | - * | |
| 47 | - * @var integer | |
| 48 | - */ | |
| 49 | - const MULTIPLIER = 1; | |
| 50 | - | |
| 51 | - /** | |
| 52 | - * @var string | |
| 53 | - */ | |
| 54 | - const ID_ATTRIBUTE_MATCHER = '/(\\w+)?\\#([\\w\\-]+)/'; | |
| 55 | - | |
| 56 | - /** | |
| 57 | - * @var string | |
| 58 | - */ | |
| 59 | - const CLASS_ATTRIBUTE_MATCHER = '/(\\w+|[\\*\\]])?((\\.[\\w\\-]+)+)/'; | |
| 60 | - | |
| 61 | - /** | |
| 62 | - * @var string | |
| 63 | - */ | |
| 64 | - private $html = ''; | |
| 65 | - | |
| 66 | - /** | |
| 67 | - * @var string | |
| 68 | - */ | |
| 69 | - private $css = ''; | |
| 70 | - | |
| 71 | - /** | |
| 72 | - * @var array<string> | |
| 73 | - */ | |
| 74 | -	private $unprocessableHtmlTags = array('wbr'); | |
| 75 | - | |
| 76 | - /** | |
| 77 | - * @var array<array> | |
| 78 | - */ | |
| 79 | - private $caches = array( | |
| 80 | - self::CACHE_KEY_CSS => array(), | |
| 81 | - self::CACHE_KEY_SELECTOR => array(), | |
| 82 | - self::CACHE_KEY_XPATH => array(), | |
| 83 | - self::CACHE_KEY_CSS_DECLARATION_BLOCK => array(), | |
| 84 | - ); | |
| 85 | - | |
| 86 | - /** | |
| 87 | - * the visited nodes with the XPath paths as array keys. | |
| 88 | - * | |
| 89 | - * @var array<\DOMNode> | |
| 90 | - */ | |
| 91 | - private $visitedNodes = array(); | |
| 92 | - | |
| 93 | - /** | |
| 94 | - * the styles to apply to the nodes with the XPath paths as array keys for the outer array and the attribute names/values. | |
| 95 | - * as key/value pairs for the inner array. | |
| 96 | - * | |
| 97 | - * @var array<array><string> | |
| 98 | - */ | |
| 99 | - private $styleAttributesForNodes = array(); | |
| 100 | - | |
| 101 | - /** | |
| 102 | - * This attribute applies to the case where you want to preserve your original text encoding. | |
| 103 | - * | |
| 104 | - * By default, emogrifier translates your text into HTML entities for two reasons: | |
| 105 | - * | |
| 106 | - * 1. Because of client incompatibilities, it is better practice to send out HTML entities rather than unicode over email. | |
| 107 | - * | |
| 108 | - * 2. It translates any illegal XML characters that DOMDocument cannot work with. | |
| 109 | - * | |
| 110 | - * If you would like to preserve your original encoding, set this attribute to TRUE. | |
| 111 | - * | |
| 112 | - * @var boolean | |
| 113 | - */ | |
| 114 | - public $preserveEncoding = false; | |
| 115 | - | |
| 116 | - public static $_media = ''; | |
| 117 | - | |
| 118 | - /** | |
| 119 | - * The constructor. | |
| 120 | - * | |
| 121 | - * @param string $html the HTML to emogrify, must be UTF-8-encoded | |
| 122 | - * @param string $css the CSS to merge, must be UTF-8-encoded | |
| 123 | - */ | |
| 124 | -	public function __construct($html = '', $css = '') { | |
| 125 | - $this->setHtml($html); | |
| 126 | - $this->setCss($css); | |
| 127 | - } | |
| 128 | - | |
| 129 | - /** | |
| 130 | - * The destructor. | |
| 131 | - */ | |
| 132 | -	public function __destruct() { | |
| 133 | - $this->purgeVisitedNodes(); | |
| 134 | - } | |
| 135 | - | |
| 136 | - /** | |
| 137 | - * Sets the HTML to emogrify. | |
| 138 | - * | |
| 139 | - * @param string $html the HTML to emogrify, must be UTF-8-encoded | |
| 140 | - */ | |
| 141 | -	public function setHtml($html = '') { | |
| 142 | - $this->html = $html; | |
| 143 | - } | |
| 144 | - | |
| 145 | - /** | |
| 146 | - * Sets the CSS to merge with the HTML. | |
| 147 | - * | |
| 148 | - * @param string $css the CSS to merge, must be UTF-8-encoded | |
| 149 | - */ | |
| 150 | -	public function setCss($css = '') { | |
| 151 | - $this->css = $css; | |
| 152 | - } | |
| 153 | - | |
| 154 | - /** | |
| 155 | - * Clears all caches. | |
| 156 | - */ | |
| 157 | -	private function clearAllCaches() { | |
| 158 | - $this->clearCache(self::CACHE_KEY_CSS); | |
| 159 | - $this->clearCache(self::CACHE_KEY_SELECTOR); | |
| 160 | - $this->clearCache(self::CACHE_KEY_XPATH); | |
| 161 | - $this->clearCache(self::CACHE_KEY_CSS_DECLARATION_BLOCK); | |
| 162 | - } | |
| 163 | - | |
| 164 | - /** | |
| 165 | - * Clears a single cache by key. | |
| 166 | - * | |
| 167 | - * @param integer $key the cache key, must be CACHE_KEY_CSS, CACHE_KEY_SELECTOR, CACHE_KEY_XPATH or CACHE_KEY_CSS_DECLARATION_BLOCK | |
| 168 | - * | |
| 169 | - * @throws InvalidArgumentException | |
| 170 | - */ | |
| 171 | -	private function clearCache($key) { | |
| 172 | - $allowedCacheKeys = array(self::CACHE_KEY_CSS, self::CACHE_KEY_SELECTOR, self::CACHE_KEY_XPATH, self::CACHE_KEY_CSS_DECLARATION_BLOCK); | |
| 173 | -		if (!in_array($key, $allowedCacheKeys, true)) { | |
| 174 | -			throw new InvalidArgumentException('Invalid cache key: ' . $key, 1391822035); | |
| 175 | - } | |
| 176 | - | |
| 177 | - $this->caches[$key] = array(); | |
| 178 | - } | |
| 179 | - | |
| 180 | - /** | |
| 181 | - * Purges the visited nodes. | |
| 182 | - */ | |
| 183 | -	private function purgeVisitedNodes() { | |
| 184 | - $this->visitedNodes = array(); | |
| 185 | - $this->styleAttributesForNodes = array(); | |
| 186 | - } | |
| 187 | - | |
| 188 | - /** | |
| 189 | - * Marks a tag for removal. | |
| 190 | - * | |
| 191 | - * There are some HTML tags that DOMDocument cannot process, and it will throw an error if it encounters them. | |
| 192 | - * In particular, DOMDocument will complain if you try to use HTML5 tags in an XHTML document. | |
| 193 | - * | |
| 194 | - * Note: The tags will not be removed if they have any content. | |
| 195 | - * | |
| 196 | - * @param string $tagName the tag name, e.g., "p" | |
| 197 | - */ | |
| 198 | -	public function addUnprocessableHtmlTag($tagName) { | |
| 199 | - $this->unprocessableHtmlTags[] = $tagName; | |
| 200 | - } | |
| 201 | - | |
| 202 | - /** | |
| 203 | - * Drops a tag from the removal list. | |
| 204 | - * | |
| 205 | - * @param string $tagName the tag name, e.g., "p" | |
| 206 | - */ | |
| 207 | -	public function removeUnprocessableHtmlTag($tagName) { | |
| 208 | - $key = array_search($tagName, $this->unprocessableHtmlTags, true); | |
| 209 | -		if ($key !== false) { | |
| 210 | - unset($this->unprocessableHtmlTags[$key]); | |
| 211 | - } | |
| 212 | - } | |
| 213 | - | |
| 214 | - /** | |
| 215 | - * Applies the CSS you submit to the HTML you submit. | |
| 216 | - * | |
| 217 | - * This method places the CSS inline. | |
| 218 | - * | |
| 219 | - * @return string | |
| 220 | - * | |
| 221 | - * @throws BadMethodCallException | |
| 222 | - */ | |
| 223 | -	public function emogrify() { | |
| 224 | -		if ($this->html === '') { | |
| 225 | -			throw new BadMethodCallException('Please set some HTML first before calling emogrify.', 1390393096); | |
| 226 | - } | |
| 227 | - | |
| 228 | - $xmlDocument = $this->createXmlDocument(); | |
| 229 | - $xpath = new DOMXPath($xmlDocument); | |
| 230 | - $this->clearAllCaches(); | |
| 231 | - | |
| 232 | - // before be begin processing the CSS file, parse the document and normalize all existing CSS attributes (changes 'DISPLAY: none' to 'display: none'); | |
| 233 | - // we wouldn't have to do this if DOMXPath supported XPath 2.0. | |
| 234 | - // also store a reference of nodes with existing inline styles so we don't overwrite them | |
| 235 | - $this->purgeVisitedNodes(); | |
| 236 | - | |
| 237 | -		$nodesWithStyleAttributes = $xpath->query('//*[@style]'); | |
| 238 | -		if ($nodesWithStyleAttributes !== false) { | |
| 239 | - /** @var $nodeWithStyleAttribute DOMNode */ | |
| 240 | -			foreach ($nodesWithStyleAttributes as $node) { | |
| 241 | -				$normalizedOriginalStyle = preg_replace_callback( '/[A-z\\-]+(?=\\:)/S', array( $this, 'strtolower' ), $node->getAttribute('style') ); | |
| 242 | - | |
| 243 | - // in order to not overwrite existing style attributes in the HTML, we have to save the original HTML styles | |
| 244 | - $nodePath = $node->getNodePath(); | |
| 245 | -				if (!isset($this->styleAttributesForNodes[$nodePath])) { | |
| 246 | - $this->styleAttributesForNodes[$nodePath] = $this->parseCssDeclarationBlock($normalizedOriginalStyle); | |
| 247 | - $this->visitedNodes[$nodePath] = $node; | |
| 248 | - } | |
| 249 | - | |
| 250 | -				$node->setAttribute('style', $normalizedOriginalStyle); | |
| 251 | - } | |
| 252 | - } | |
| 253 | - | |
| 254 | - // grab any existing style blocks from the html and append them to the existing CSS | |
| 255 | - // (these blocks should be appended so as to have precedence over conflicting styles in the existing CSS) | |
| 256 | - $allCss = $this->css; | |
| 257 | - | |
| 258 | - $allCss .= $this->getCssFromAllStyleNodes($xpath); | |
| 259 | - | |
| 260 | - $cssParts = $this->splitCssAndMediaQuery($allCss); | |
| 261 | - self::$_media = ''; // reset | |
| 262 | - | |
| 263 | - $cssKey = md5($cssParts['css']); | |
| 264 | -		if (!isset($this->caches[self::CACHE_KEY_CSS][$cssKey])) { | |
| 265 | - // process the CSS file for selectors and definitions | |
| 266 | -			preg_match_all('/(?:^|[\\s^{}]*)([^{]+){([^}]*)}/mis', $cssParts['css'], $matches, PREG_SET_ORDER); | |
| 267 | - | |
| 268 | - $allSelectors = array(); | |
| 269 | -			foreach ($matches as $key => $selectorString) { | |
| 270 | - // if there is a blank definition, skip | |
| 271 | -				if (!strlen(trim($selectorString[2]))) { | |
| 272 | - continue; | |
| 273 | - } | |
| 274 | - | |
| 275 | - // else split by commas and duplicate attributes so we can sort by selector precedence | |
| 276 | -				$selectors = explode(',', $selectorString[1]); | |
| 277 | -				foreach ($selectors as $selector) { | |
| 278 | - // don't process pseudo-elements and behavioral (dynamic) pseudo-classes; ONLY allow structural pseudo-classes | |
| 279 | -					if (strpos($selector, ':') !== false && !preg_match('/:\\S+\\-(child|type)\\(/i', $selector)) { | |
| 280 | - continue; | |
| 281 | - } | |
| 282 | - | |
| 283 | -					$allSelectors[] = array('selector' => trim($selector), | |
| 284 | - 'attributes' => trim($selectorString[2]), | |
| 285 | - // keep track of where it appears in the file, since order is important | |
| 286 | - 'line' => $key, | |
| 287 | - ); | |
| 288 | - } | |
| 289 | - } | |
| 290 | - | |
| 291 | - // now sort the selectors by precedence | |
| 292 | - usort($allSelectors, array($this,'sortBySelectorPrecedence')); | |
| 293 | - | |
| 294 | - $this->caches[self::CACHE_KEY_CSS][$cssKey] = $allSelectors; | |
| 295 | - } | |
| 296 | - | |
| 297 | -		foreach ($this->caches[self::CACHE_KEY_CSS][$cssKey] as $value) { | |
| 298 | - // query the body for the xpath selector | |
| 299 | - $nodesMatchingCssSelectors = $xpath->query($this->translateCssToXpath($value['selector'])); | |
| 300 | - | |
| 301 | - /** @var $node \DOMNode */ | |
| 302 | -			foreach ($nodesMatchingCssSelectors as $node) { | |
| 303 | - // if it has a style attribute, get it, process it, and append (overwrite) new stuff | |
| 304 | -				if ($node->hasAttribute('style')) { | |
| 305 | - // break it up into an associative array | |
| 306 | -					$oldStyleDeclarations = $this->parseCssDeclarationBlock($node->getAttribute('style')); | |
| 307 | -				} else { | |
| 308 | - $oldStyleDeclarations = array(); | |
| 309 | - } | |
| 310 | - $newStyleDeclarations = $this->parseCssDeclarationBlock($value['attributes']); | |
| 311 | -				$node->setAttribute('style', $this->generateStyleStringFromDeclarationsArrays($oldStyleDeclarations, $newStyleDeclarations)); | |
| 312 | - } | |
| 313 | - } | |
| 314 | - | |
| 315 | - // now iterate through the nodes that contained inline styles in the original HTML | |
| 316 | -		foreach ($this->styleAttributesForNodes as $nodePath => $styleAttributesForNode) { | |
| 317 | - $node = $this->visitedNodes[$nodePath]; | |
| 318 | -			$currentStyleAttributes = $this->parseCssDeclarationBlock($node->getAttribute('style')); | |
| 319 | -			$node->setAttribute('style', $this->generateStyleStringFromDeclarationsArrays($currentStyleAttributes, $styleAttributesForNode)); | |
| 320 | - } | |
| 321 | - | |
| 322 | - // This removes styles from your email that contain display:none. | |
| 323 | - // We need to look for display:none, but we need to do a case-insensitive search. Since DOMDocument only supports XPath 1.0, | |
| 324 | - // lower-case() isn't available to us. We've thus far only set attributes to lowercase, not attribute values. Consequently, we need | |
| 325 | -		// to translate() the letters that would be in 'NONE' ("NOE") to lowercase. | |
| 326 | -		$nodesWithStyleDisplayNone = $xpath->query('//*[contains(translate(translate(@style," ",""),"NOE","noe"),"display:none")]'); | |
| 327 | - // The checks on parentNode and is_callable below ensure that if we've deleted the parent node, | |
| 328 | - // we don't try to call removeChild on a nonexistent child node | |
| 329 | -		if ($nodesWithStyleDisplayNone->length > 0) { | |
| 330 | - /** @var $node \DOMNode */ | |
| 331 | -			foreach ($nodesWithStyleDisplayNone as $node) { | |
| 332 | -				if ($node->parentNode && is_callable(array($node->parentNode,'removeChild'))) { | |
| 333 | - $node->parentNode->removeChild($node); | |
| 334 | - } | |
| 335 | - } | |
| 336 | - } | |
| 337 | - | |
| 338 | - $this->copyCssWithMediaToStyleNode($cssParts, $xmlDocument); | |
| 339 | - | |
| 340 | -		if ($this->preserveEncoding) { | |
| 341 | -			if ( function_exists( 'mb_convert_encoding' ) ) { | |
| 342 | - return mb_convert_encoding( $xmlDocument->saveHTML(), self::ENCODING, 'HTML-ENTITIES' ); | |
| 343 | -			} else { | |
| 344 | - return htmlspecialchars_decode( utf8_encode( html_entity_decode( $xmlDocument->saveHTML(), ENT_COMPAT, self::ENCODING ) ) ); | |
| 345 | - } | |
| 346 | -		} else { | |
| 347 | - return $xmlDocument->saveHTML(); | |
| 348 | - } | |
| 349 | - } | |
| 350 | - | |
| 351 | -	public function strtolower(array $m) { | |
| 352 | - return strtolower($m[0]); | |
| 353 | - } | |
| 354 | - | |
| 355 | - | |
| 356 | - /** | |
| 357 | - * This method merges old or existing name/value array with new name/value array. | |
| 358 | - * and then generates a string of the combined style suitable for placing inline. | |
| 359 | - * This becomes the single point for CSS string generation allowing for consistent. | |
| 360 | - * CSS output no matter where the CSS originally came from. | |
| 361 | - * @param array $oldStyles | |
| 362 | - * @param array $newStyles | |
| 363 | - * @return string | |
| 364 | - */ | |
| 365 | -	private function generateStyleStringFromDeclarationsArrays(array $oldStyles, array $newStyles) { | |
| 366 | - $combinedStyles = array_merge($oldStyles, $newStyles); | |
| 367 | - $style = ''; | |
| 368 | -		foreach ($combinedStyles as $attributeName => $attributeValue) { | |
| 369 | - $style .= (strtolower(trim($attributeName)) . ': ' . trim($attributeValue) . '; '); | |
| 370 | - } | |
| 371 | - return trim($style); | |
| 372 | - } | |
| 373 | - | |
| 374 | - | |
| 375 | - /** | |
| 376 | - * Copies the media part from CSS array parts to $xmlDocument. | |
| 377 | - * | |
| 378 | - * @param array $cssParts | |
| 379 | - * @param DOMDocument $xmlDocument | |
| 380 | - */ | |
| 381 | -	public function copyCssWithMediaToStyleNode(array $cssParts, DOMDocument $xmlDocument) { | |
| 382 | -		if (isset($cssParts['media']) && $cssParts['media'] !== '') { | |
| 383 | - $this->addStyleElementToDocument($xmlDocument, $cssParts['media']); | |
| 384 | - } | |
| 385 | - } | |
| 386 | - | |
| 387 | - /** | |
| 388 | - * Returns CSS content. | |
| 389 | - * | |
| 390 | - * @param DOMXPath $xpath | |
| 391 | - * @return string | |
| 392 | - */ | |
| 393 | -	private function getCssFromAllStyleNodes(DOMXPath $xpath) { | |
| 394 | -		$styleNodes = $xpath->query('//style'); | |
| 395 | - | |
| 396 | -		if ($styleNodes === false) { | |
| 397 | - return ''; | |
| 398 | - } | |
| 399 | - | |
| 400 | - $css = ''; | |
| 401 | - /** @var $styleNode DOMNode */ | |
| 402 | -		foreach ($styleNodes as $styleNode) { | |
| 403 | - $css .= "\n\n" . $styleNode->nodeValue; | |
| 404 | - $styleNode->parentNode->removeChild($styleNode); | |
| 405 | - } | |
| 406 | - | |
| 407 | - return $css; | |
| 408 | - } | |
| 409 | - | |
| 410 | - /** | |
| 411 | - * Adds a style element with $css to $document. | |
| 412 | - * | |
| 413 | - * @param DOMDocument $document | |
| 414 | - * @param string $css | |
| 415 | - */ | |
| 416 | -	private function addStyleElementToDocument(DOMDocument $document, $css) { | |
| 417 | -		$styleElement = $document->createElement('style', $css); | |
| 418 | -		$styleAttribute = $document->createAttribute('type'); | |
| 419 | - $styleAttribute->value = 'text/css'; | |
| 420 | - $styleElement->appendChild($styleAttribute); | |
| 421 | - | |
| 422 | - $head = $this->getOrCreateHeadElement($document); | |
| 423 | - $head->appendChild($styleElement); | |
| 424 | - } | |
| 425 | - | |
| 426 | - /** | |
| 427 | - * Returns the existing or creates a new head element in $document. | |
| 428 | - * | |
| 429 | - * @param DOMDocument $document | |
| 430 | - * @return DOMNode the head element | |
| 431 | - */ | |
| 432 | -	private function getOrCreateHeadElement(DOMDocument $document) { | |
| 433 | -		$head = $document->getElementsByTagName('head')->item(0); | |
| 434 | - | |
| 435 | -		if ($head === null) { | |
| 436 | -			$head = $document->createElement('head'); | |
| 437 | -			$html = $document->getElementsByTagName('html')->item(0); | |
| 438 | -			$html->insertBefore($head, $document->getElementsByTagName('body')->item(0)); | |
| 439 | - } | |
| 440 | - | |
| 441 | - return $head; | |
| 442 | - } | |
| 443 | - | |
| 444 | - /** | |
| 445 | - * Splits input CSS code to an array where: | |
| 446 | - * | |
| 447 | - * - key "css" will be contains clean CSS code. | |
| 448 | - * - key "media" will be contains all valuable media queries. | |
| 449 | - * | |
| 450 | - * Example: | |
| 451 | - * | |
| 452 | - * The CSS code. | |
| 453 | - * | |
| 454 | -	 *   "@import "file.css"; h1 { color:red; } @media { h1 {}} @media tv { h1 {}}" | |
| 455 | - * | |
| 456 | - * will be parsed into the following array: | |
| 457 | - * | |
| 458 | -	 *   "css" => "h1 { color:red; }" | |
| 459 | -	 *   "media" => "@media { h1 {}}" | |
| 460 | - * | |
| 461 | - * @param string $css | |
| 462 | - * @return array | |
| 463 | - */ | |
| 464 | -	private function splitCssAndMediaQuery($css) { | |
| 465 | -		$css = preg_replace_callback( '#@media\\s+(?:only\\s)?(?:[\\s{\(]|screen|all)\\s?[^{]+{.*}\\s*}\\s*#misU', array( $this, '_media_concat' ), $css ); | |
| 466 | - | |
| 467 | - // filter the CSS | |
| 468 | - $search = array( | |
| 469 | - // get rid of css comment code | |
| 470 | - '/\\/\\*.*\\*\\//sU', | |
| 471 | - // strip out any import directives | |
| 472 | - '/^\\s*@import\\s[^;]+;/misU', | |
| 473 | - // strip remains media enclosures | |
| 474 | -			'/^\\s*@media\\s[^{]+{(.*)}\\s*}\\s/misU', | |
| 475 | - ); | |
| 476 | - | |
| 477 | - $replace = array( | |
| 478 | - '', | |
| 479 | - '', | |
| 480 | - '', | |
| 481 | - ); | |
| 482 | - | |
| 483 | - // clean CSS before output | |
| 484 | - $css = preg_replace($search, $replace, $css); | |
| 485 | - | |
| 486 | -		return array('css' => $css, 'media' => self::$_media); | |
| 487 | - } | |
| 488 | - | |
| 489 | -	private function _media_concat( $matches ) { | |
| 490 | - self::$_media .= $matches[0]; | |
| 491 | - } | |
| 492 | - | |
| 493 | - /** | |
| 494 | - * Creates a DOMDocument instance with the current HTML. | |
| 495 | - * | |
| 496 | - * @return DOMDocument | |
| 497 | - */ | |
| 498 | -	private function createXmlDocument() { | |
| 499 | - $xmlDocument = new DOMDocument; | |
| 500 | - $xmlDocument->encoding = self::ENCODING; | |
| 501 | - $xmlDocument->strictErrorChecking = false; | |
| 502 | - $xmlDocument->formatOutput = true; | |
| 503 | - $libXmlState = libxml_use_internal_errors(true); | |
| 504 | - $xmlDocument->loadHTML($this->getUnifiedHtml()); | |
| 505 | - libxml_clear_errors(); | |
| 506 | - libxml_use_internal_errors($libXmlState); | |
| 507 | - $xmlDocument->normalizeDocument(); | |
| 508 | - | |
| 509 | - return $xmlDocument; | |
| 510 | - } | |
| 511 | - | |
| 512 | - /** | |
| 513 | - * Returns the HTML with the non-ASCII characters converts into HTML entities and the unprocessable HTML tags removed. | |
| 514 | - * | |
| 515 | - * @return string the unified HTML | |
| 516 | - * | |
| 517 | - * @throws BadMethodCallException | |
| 518 | - */ | |
| 519 | -	private function getUnifiedHtml() { | |
| 520 | -		if (!empty($this->unprocessableHtmlTags)) { | |
| 521 | -			$unprocessableHtmlTags = implode('|', $this->unprocessableHtmlTags); | |
| 522 | -			$bodyWithoutUnprocessableTags = preg_replace('/<\\/?(' . $unprocessableHtmlTags . ')[^>]*>/i', '', $this->html); | |
| 523 | -		} else { | |
| 524 | - $bodyWithoutUnprocessableTags = $this->html; | |
| 525 | - } | |
| 526 | - | |
| 527 | -		if ( function_exists( 'mb_convert_encoding' ) ) { | |
| 528 | - return mb_convert_encoding( $bodyWithoutUnprocessableTags, 'HTML-ENTITIES', self::ENCODING ); | |
| 529 | -		} else { | |
| 530 | - return htmlspecialchars_decode( utf8_decode( htmlentities( $bodyWithoutUnprocessableTags, ENT_COMPAT, self::ENCODING, false ) ) ); | |
| 531 | - } | |
| 532 | - } | |
| 533 | - | |
| 534 | - /** | |
| 535 | - * @param array $a | |
| 536 | - * @param array $b | |
| 537 | - * | |
| 538 | - * @return integer | |
| 539 | - */ | |
| 540 | -	private function sortBySelectorPrecedence(array $a, array $b) { | |
| 541 | - $precedenceA = $this->getCssSelectorPrecedence($a['selector']); | |
| 542 | - $precedenceB = $this->getCssSelectorPrecedence($b['selector']); | |
| 543 | - | |
| 544 | - // We want these sorted in ascending order so selectors with lesser precedence get processed first and | |
| 545 | - // selectors with greater precedence get sorted last. | |
| 546 | - // The parenthesis around the -1 are necessary to avoid a PHP_CodeSniffer warning about missing spaces around | |
| 547 | - // arithmetic operators. | |
| 548 | - // @see http://forge.typo3.org/issues/55605 | |
| 549 | - $precedenceForEquals = ($a['line'] < $b['line'] ? (-1) : 1); | |
| 550 | - $precedenceForNotEquals = ($precedenceA < $precedenceB ? (-1) : 1); | |
| 551 | - return ($precedenceA === $precedenceB) ? $precedenceForEquals : $precedenceForNotEquals; | |
| 552 | - } | |
| 553 | - | |
| 554 | - /** | |
| 555 | - * @param string $selector | |
| 556 | - * | |
| 557 | - * @return integer | |
| 558 | - */ | |
| 559 | -	private function getCssSelectorPrecedence($selector) { | |
| 560 | - $selectorKey = md5($selector); | |
| 561 | -		if (!isset($this->caches[self::CACHE_KEY_SELECTOR][$selectorKey])) { | |
| 562 | - $precedence = 0; | |
| 563 | - $value = 100; | |
| 564 | - // ids: worth 100, classes: worth 10, elements: worth 1 | |
| 565 | -			$search = array('\\#','\\.',''); | |
| 566 | - | |
| 567 | -			foreach ($search as $s) { | |
| 568 | -				if (trim($selector == '')) { | |
| 569 | - break; | |
| 570 | - } | |
| 571 | - $number = 0; | |
| 572 | -				$selector = preg_replace('/' . $s . '\\w+/', '', $selector, -1, $number); | |
| 573 | - $precedence += ($value * $number); | |
| 574 | - $value /= 10; | |
| 575 | - } | |
| 576 | - $this->caches[self::CACHE_KEY_SELECTOR][$selectorKey] = $precedence; | |
| 577 | - } | |
| 578 | - | |
| 579 | - return $this->caches[self::CACHE_KEY_SELECTOR][$selectorKey]; | |
| 580 | - } | |
| 581 | - | |
| 582 | - /** | |
| 583 | - * Right now, we support all CSS 1 selectors and most CSS2/3 selectors. | |
| 584 | - * | |
| 585 | - * @see http://plasmasturm.org/log/444/ | |
| 586 | - * | |
| 587 | - * @param string $paramCssSelector | |
| 588 | - * | |
| 589 | - * @return string | |
| 590 | - */ | |
| 591 | -	private function translateCssToXpath($paramCssSelector) { | |
| 592 | - $cssSelector = ' ' . $paramCssSelector . ' '; | |
| 593 | - $cssSelector = preg_replace_callback( '/\s+\w+\s+/', array( $this, 'strtolower' ), $cssSelector ); | |
| 594 | - $cssSelector = trim($cssSelector); | |
| 595 | - $xpathKey = md5($cssSelector); | |
| 596 | -		if (!isset($this->caches[self::CACHE_KEY_XPATH][$xpathKey])) { | |
| 597 | - // returns an Xpath selector | |
| 598 | - $search = array( | |
| 599 | - // Matches any element that is a child of parent. | |
| 600 | - '/\\s+>\\s+/', | |
| 601 | - // Matches any element that is an adjacent sibling. | |
| 602 | - '/\\s+\\+\\s+/', | |
| 603 | - // Matches any element that is a descendant of an parent element element. | |
| 604 | - '/\\s+/', | |
| 605 | - // first-child pseudo-selector | |
| 606 | - '/([^\\/]+):first-child/i', | |
| 607 | - // last-child pseudo-selector | |
| 608 | - '/([^\\/]+):last-child/i', | |
| 609 | - // Matches attribute only selector | |
| 610 | - '/^\\[(\\w+)\\]/', | |
| 611 | - // Matches element with attribute | |
| 612 | - '/(\\w)\\[(\\w+)\\]/', | |
| 613 | - // Matches element with EXACT attribute | |
| 614 | - '/(\\w)\\[(\\w+)\\=[\'"]?(\\w+)[\'"]?\\]/', | |
| 615 | - ); | |
| 616 | - $replace = array( | |
| 617 | - '/', | |
| 618 | - '/following-sibling::*[1]/self::', | |
| 619 | - '//', | |
| 620 | - '*[1]/self::\\1', | |
| 621 | - '*[last()]/self::\\1', | |
| 622 | - '*[@\\1]', | |
| 623 | - '\\1[@\\2]', | |
| 624 | - '\\1[@\\2="\\3"]', | |
| 625 | - ); | |
| 626 | - | |
| 627 | - $cssSelector = '//' . preg_replace($search, $replace, $cssSelector); | |
| 628 | - | |
| 629 | - $cssSelector = preg_replace_callback(self::ID_ATTRIBUTE_MATCHER, array($this, 'matchIdAttributes'), $cssSelector); | |
| 630 | - $cssSelector = preg_replace_callback(self::CLASS_ATTRIBUTE_MATCHER, array($this, 'matchClassAttributes'), $cssSelector); | |
| 631 | - | |
| 632 | - // Advanced selectors are going to require a bit more advanced emogrification. | |
| 633 | - // When we required PHP 5.3, we could do this with closures. | |
| 634 | - $cssSelector = preg_replace_callback( | |
| 635 | - '/([^\\/]+):nth-child\\(\s*(odd|even|[+\-]?\\d|[+\\-]?\\d?n(\\s*[+\\-]\\s*\\d)?)\\s*\\)/i', | |
| 636 | - array($this, 'translateNthChild'), $cssSelector | |
| 637 | - ); | |
| 638 | - $cssSelector = preg_replace_callback( | |
| 639 | - '/([^\\/]+):nth-of-type\\(\s*(odd|even|[+\-]?\\d|[+\\-]?\\d?n(\\s*[+\\-]\\s*\\d)?)\\s*\\)/i', | |
| 640 | - array($this, 'translateNthOfType'), $cssSelector | |
| 641 | - ); | |
| 642 | - | |
| 643 | - $this->caches[self::CACHE_KEY_SELECTOR][$xpathKey] = $cssSelector; | |
| 644 | - } | |
| 645 | - return $this->caches[self::CACHE_KEY_SELECTOR][$xpathKey]; | |
| 646 | - } | |
| 647 | - | |
| 648 | - /** | |
| 649 | - * @param array $match | |
| 650 | - * | |
| 651 | - * @return string | |
| 652 | - */ | |
| 653 | -	private function matchIdAttributes(array $match) { | |
| 654 | - return (strlen($match[1]) ? $match[1] : '*') . '[@id="' . $match[2] . '"]'; | |
| 655 | - } | |
| 656 | - | |
| 657 | - /** | |
| 658 | - * @param array $match | |
| 659 | - * | |
| 660 | - * @return string | |
| 661 | - */ | |
| 662 | -	private function matchClassAttributes(array $match) { | |
| 663 | -		return (strlen($match[1]) ? $match[1] : '*') . '[contains(concat(" ",@class," "),concat(" ","' . | |
| 664 | - implode( | |
| 665 | -				'"," "))][contains(concat(" ",@class," "),concat(" ","', | |
| 666 | -				explode('.', substr($match[2], 1)) | |
| 667 | - ) . '"," "))]'; | |
| 668 | - } | |
| 669 | - | |
| 670 | - /** | |
| 671 | - * @param array $match | |
| 672 | - * | |
| 673 | - * @return string | |
| 674 | - */ | |
| 675 | -	private function translateNthChild(array $match) { | |
| 676 | - $result = $this->parseNth($match); | |
| 677 | - | |
| 678 | -		if (isset($result[self::MULTIPLIER])) { | |
| 679 | -			if ($result[self::MULTIPLIER] < 0) { | |
| 680 | - $result[self::MULTIPLIER] = abs($result[self::MULTIPLIER]); | |
| 681 | -				return sprintf('*[(last() - position()) mod %u = %u]/self::%s', $result[self::MULTIPLIER], $result[self::INDEX], $match[1]); | |
| 682 | -			} else { | |
| 683 | -				return sprintf('*[position() mod %u = %u]/self::%s', $result[self::MULTIPLIER], $result[self::INDEX], $match[1]); | |
| 684 | - } | |
| 685 | -		} else { | |
| 686 | -			return sprintf('*[%u]/self::%s', $result[self::INDEX], $match[1]); | |
| 687 | - } | |
| 688 | - } | |
| 689 | - | |
| 690 | - /** | |
| 691 | - * @param array $match | |
| 692 | - * | |
| 693 | - * @return string | |
| 694 | - */ | |
| 695 | -	private function translateNthOfType(array $match) { | |
| 696 | - $result = $this->parseNth($match); | |
| 697 | - | |
| 698 | -		if (isset($result[self::MULTIPLIER])) { | |
| 699 | -			if ($result[self::MULTIPLIER] < 0) { | |
| 700 | - $result[self::MULTIPLIER] = abs($result[self::MULTIPLIER]); | |
| 701 | -				return sprintf('%s[(last() - position()) mod %u = %u]', $match[1], $result[self::MULTIPLIER], $result[self::INDEX]); | |
| 702 | -			} else { | |
| 703 | -				return sprintf('%s[position() mod %u = %u]', $match[1], $result[self::MULTIPLIER], $result[self::INDEX]); | |
| 704 | - } | |
| 705 | -		} else { | |
| 706 | -			return sprintf('%s[%u]', $match[1], $result[self::INDEX]); | |
| 707 | - } | |
| 708 | - } | |
| 709 | - | |
| 710 | - /** | |
| 711 | - * @param array $match | |
| 712 | - * | |
| 713 | - * @return array | |
| 714 | - */ | |
| 715 | -	private function parseNth(array $match) { | |
| 716 | -		if (in_array(strtolower($match[2]), array('even','odd'))) { | |
| 717 | - $index = strtolower($match[2]) == 'even' ? 0 : 1; | |
| 718 | - return array(self::MULTIPLIER => 2, self::INDEX => $index); | |
| 719 | -		} elseif (stripos($match[2], 'n') === false) { | |
| 720 | - // if there is a multiplier | |
| 721 | -			$index = intval(str_replace(' ', '', $match[2])); | |
| 722 | - return array(self::INDEX => $index); | |
| 723 | -		} else { | |
| 724 | -			if (isset($match[3])) { | |
| 725 | - $multipleTerm = str_replace($match[3], '', $match[2]); | |
| 726 | -				$index = intval(str_replace(' ', '', $match[3])); | |
| 727 | -			} else { | |
| 728 | - $multipleTerm = $match[2]; | |
| 729 | - $index = 0; | |
| 730 | - } | |
| 731 | - | |
| 732 | -			$multiplier = str_ireplace('n', '', $multipleTerm); | |
| 733 | - | |
| 734 | -			if (!strlen($multiplier)) { | |
| 735 | - $multiplier = 1; | |
| 736 | -			} elseif ($multiplier == 0) { | |
| 737 | - return array(self::INDEX => $index); | |
| 738 | -			} else { | |
| 739 | - $multiplier = intval($multiplier); | |
| 740 | - } | |
| 741 | - | |
| 742 | -			while ($index < 0) { | |
| 743 | - $index += abs($multiplier); | |
| 744 | - } | |
| 745 | - | |
| 746 | - return array(self::MULTIPLIER => $multiplier, self::INDEX => $index); | |
| 747 | - } | |
| 748 | - } | |
| 749 | - | |
| 750 | - /** | |
| 751 | - * Parses a CSS declaration block into property name/value pairs. | |
| 752 | - * | |
| 753 | - * Example: | |
| 754 | - * | |
| 755 | - * The declaration block. | |
| 756 | - * | |
| 757 | - * "color: #000; font-weight: bold;". | |
| 758 | - * | |
| 759 | - * will be parsed into the following array: | |
| 760 | - * | |
| 761 | - * "color" => "#000" | |
| 762 | - * "font-weight" => "bold" | |
| 763 | - * | |
| 764 | - * @param string $cssDeclarationBlock the CSS declaration block without the curly braces, may be empty | |
| 765 | - * | |
| 766 | - * @return array the CSS declarations with the property names as array keys and the property values as array values | |
| 767 | - */ | |
| 768 | -	private function parseCssDeclarationBlock($cssDeclarationBlock) { | |
| 769 | -		if (isset($this->caches[self::CACHE_KEY_CSS_DECLARATION_BLOCK][$cssDeclarationBlock])) { | |
| 770 | - return $this->caches[self::CACHE_KEY_CSS_DECLARATION_BLOCK][$cssDeclarationBlock]; | |
| 771 | - } | |
| 772 | - | |
| 773 | - $properties = array(); | |
| 774 | -		$declarations = explode(';', $cssDeclarationBlock); | |
| 775 | -		foreach ($declarations as $declaration) { | |
| 776 | - $matches = array(); | |
| 777 | -			if (!preg_match('/ *([A-Za-z\\-]+) *: *([^;]+) */', $declaration, $matches)) { | |
| 778 | - continue; | |
| 779 | - } | |
| 780 | - $propertyName = strtolower($matches[1]); | |
| 781 | - $propertyValue = $matches[2]; | |
| 782 | - $properties[$propertyName] = $propertyValue; | |
| 783 | - } | |
| 784 | - $this->caches[self::CACHE_KEY_CSS_DECLARATION_BLOCK][$cssDeclarationBlock] = $properties; | |
| 785 | - | |
| 786 | - return $properties; | |
| 787 | - } | |
| 12 | + /** | |
| 13 | + * @var string | |
| 14 | + */ | |
| 15 | + const ENCODING = 'UTF-8'; | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * @var integer | |
| 19 | + */ | |
| 20 | + const CACHE_KEY_CSS = 0; | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * @var integer | |
| 24 | + */ | |
| 25 | + const CACHE_KEY_SELECTOR = 1; | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * @var integer | |
| 29 | + */ | |
| 30 | + const CACHE_KEY_XPATH = 2; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * @var integer | |
| 34 | + */ | |
| 35 | + const CACHE_KEY_CSS_DECLARATION_BLOCK = 3; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * for calculating nth-of-type and nth-child selectors. | |
| 39 | + * | |
| 40 | + * @var integer | |
| 41 | + */ | |
| 42 | + const INDEX = 0; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * for calculating nth-of-type and nth-child selectors. | |
| 46 | + * | |
| 47 | + * @var integer | |
| 48 | + */ | |
| 49 | + const MULTIPLIER = 1; | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * @var string | |
| 53 | + */ | |
| 54 | + const ID_ATTRIBUTE_MATCHER = '/(\\w+)?\\#([\\w\\-]+)/'; | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * @var string | |
| 58 | + */ | |
| 59 | + const CLASS_ATTRIBUTE_MATCHER = '/(\\w+|[\\*\\]])?((\\.[\\w\\-]+)+)/'; | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * @var string | |
| 63 | + */ | |
| 64 | + private $html = ''; | |
| 65 | + | |
| 66 | + /** | |
| 67 | + * @var string | |
| 68 | + */ | |
| 69 | + private $css = ''; | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * @var array<string> | |
| 73 | + */ | |
| 74 | +    private $unprocessableHtmlTags = array('wbr'); | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * @var array<array> | |
| 78 | + */ | |
| 79 | + private $caches = array( | |
| 80 | + self::CACHE_KEY_CSS => array(), | |
| 81 | + self::CACHE_KEY_SELECTOR => array(), | |
| 82 | + self::CACHE_KEY_XPATH => array(), | |
| 83 | + self::CACHE_KEY_CSS_DECLARATION_BLOCK => array(), | |
| 84 | + ); | |
| 85 | + | |
| 86 | + /** | |
| 87 | + * the visited nodes with the XPath paths as array keys. | |
| 88 | + * | |
| 89 | + * @var array<\DOMNode> | |
| 90 | + */ | |
| 91 | + private $visitedNodes = array(); | |
| 92 | + | |
| 93 | + /** | |
| 94 | + * the styles to apply to the nodes with the XPath paths as array keys for the outer array and the attribute names/values. | |
| 95 | + * as key/value pairs for the inner array. | |
| 96 | + * | |
| 97 | + * @var array<array><string> | |
| 98 | + */ | |
| 99 | + private $styleAttributesForNodes = array(); | |
| 100 | + | |
| 101 | + /** | |
| 102 | + * This attribute applies to the case where you want to preserve your original text encoding. | |
| 103 | + * | |
| 104 | + * By default, emogrifier translates your text into HTML entities for two reasons: | |
| 105 | + * | |
| 106 | + * 1. Because of client incompatibilities, it is better practice to send out HTML entities rather than unicode over email. | |
| 107 | + * | |
| 108 | + * 2. It translates any illegal XML characters that DOMDocument cannot work with. | |
| 109 | + * | |
| 110 | + * If you would like to preserve your original encoding, set this attribute to TRUE. | |
| 111 | + * | |
| 112 | + * @var boolean | |
| 113 | + */ | |
| 114 | + public $preserveEncoding = false; | |
| 115 | + | |
| 116 | + public static $_media = ''; | |
| 117 | + | |
| 118 | + /** | |
| 119 | + * The constructor. | |
| 120 | + * | |
| 121 | + * @param string $html the HTML to emogrify, must be UTF-8-encoded | |
| 122 | + * @param string $css the CSS to merge, must be UTF-8-encoded | |
| 123 | + */ | |
| 124 | +    public function __construct($html = '', $css = '') { | |
| 125 | + $this->setHtml($html); | |
| 126 | + $this->setCss($css); | |
| 127 | + } | |
| 128 | + | |
| 129 | + /** | |
| 130 | + * The destructor. | |
| 131 | + */ | |
| 132 | +    public function __destruct() { | |
| 133 | + $this->purgeVisitedNodes(); | |
| 134 | + } | |
| 135 | + | |
| 136 | + /** | |
| 137 | + * Sets the HTML to emogrify. | |
| 138 | + * | |
| 139 | + * @param string $html the HTML to emogrify, must be UTF-8-encoded | |
| 140 | + */ | |
| 141 | +    public function setHtml($html = '') { | |
| 142 | + $this->html = $html; | |
| 143 | + } | |
| 144 | + | |
| 145 | + /** | |
| 146 | + * Sets the CSS to merge with the HTML. | |
| 147 | + * | |
| 148 | + * @param string $css the CSS to merge, must be UTF-8-encoded | |
| 149 | + */ | |
| 150 | +    public function setCss($css = '') { | |
| 151 | + $this->css = $css; | |
| 152 | + } | |
| 153 | + | |
| 154 | + /** | |
| 155 | + * Clears all caches. | |
| 156 | + */ | |
| 157 | +    private function clearAllCaches() { | |
| 158 | + $this->clearCache(self::CACHE_KEY_CSS); | |
| 159 | + $this->clearCache(self::CACHE_KEY_SELECTOR); | |
| 160 | + $this->clearCache(self::CACHE_KEY_XPATH); | |
| 161 | + $this->clearCache(self::CACHE_KEY_CSS_DECLARATION_BLOCK); | |
| 162 | + } | |
| 163 | + | |
| 164 | + /** | |
| 165 | + * Clears a single cache by key. | |
| 166 | + * | |
| 167 | + * @param integer $key the cache key, must be CACHE_KEY_CSS, CACHE_KEY_SELECTOR, CACHE_KEY_XPATH or CACHE_KEY_CSS_DECLARATION_BLOCK | |
| 168 | + * | |
| 169 | + * @throws InvalidArgumentException | |
| 170 | + */ | |
| 171 | +    private function clearCache($key) { | |
| 172 | + $allowedCacheKeys = array(self::CACHE_KEY_CSS, self::CACHE_KEY_SELECTOR, self::CACHE_KEY_XPATH, self::CACHE_KEY_CSS_DECLARATION_BLOCK); | |
| 173 | +        if (!in_array($key, $allowedCacheKeys, true)) { | |
| 174 | +            throw new InvalidArgumentException('Invalid cache key: ' . $key, 1391822035); | |
| 175 | + } | |
| 176 | + | |
| 177 | + $this->caches[$key] = array(); | |
| 178 | + } | |
| 179 | + | |
| 180 | + /** | |
| 181 | + * Purges the visited nodes. | |
| 182 | + */ | |
| 183 | +    private function purgeVisitedNodes() { | |
| 184 | + $this->visitedNodes = array(); | |
| 185 | + $this->styleAttributesForNodes = array(); | |
| 186 | + } | |
| 187 | + | |
| 188 | + /** | |
| 189 | + * Marks a tag for removal. | |
| 190 | + * | |
| 191 | + * There are some HTML tags that DOMDocument cannot process, and it will throw an error if it encounters them. | |
| 192 | + * In particular, DOMDocument will complain if you try to use HTML5 tags in an XHTML document. | |
| 193 | + * | |
| 194 | + * Note: The tags will not be removed if they have any content. | |
| 195 | + * | |
| 196 | + * @param string $tagName the tag name, e.g., "p" | |
| 197 | + */ | |
| 198 | +    public function addUnprocessableHtmlTag($tagName) { | |
| 199 | + $this->unprocessableHtmlTags[] = $tagName; | |
| 200 | + } | |
| 201 | + | |
| 202 | + /** | |
| 203 | + * Drops a tag from the removal list. | |
| 204 | + * | |
| 205 | + * @param string $tagName the tag name, e.g., "p" | |
| 206 | + */ | |
| 207 | +    public function removeUnprocessableHtmlTag($tagName) { | |
| 208 | + $key = array_search($tagName, $this->unprocessableHtmlTags, true); | |
| 209 | +        if ($key !== false) { | |
| 210 | + unset($this->unprocessableHtmlTags[$key]); | |
| 211 | + } | |
| 212 | + } | |
| 213 | + | |
| 214 | + /** | |
| 215 | + * Applies the CSS you submit to the HTML you submit. | |
| 216 | + * | |
| 217 | + * This method places the CSS inline. | |
| 218 | + * | |
| 219 | + * @return string | |
| 220 | + * | |
| 221 | + * @throws BadMethodCallException | |
| 222 | + */ | |
| 223 | +    public function emogrify() { | |
| 224 | +        if ($this->html === '') { | |
| 225 | +            throw new BadMethodCallException('Please set some HTML first before calling emogrify.', 1390393096); | |
| 226 | + } | |
| 227 | + | |
| 228 | + $xmlDocument = $this->createXmlDocument(); | |
| 229 | + $xpath = new DOMXPath($xmlDocument); | |
| 230 | + $this->clearAllCaches(); | |
| 231 | + | |
| 232 | + // before be begin processing the CSS file, parse the document and normalize all existing CSS attributes (changes 'DISPLAY: none' to 'display: none'); | |
| 233 | + // we wouldn't have to do this if DOMXPath supported XPath 2.0. | |
| 234 | + // also store a reference of nodes with existing inline styles so we don't overwrite them | |
| 235 | + $this->purgeVisitedNodes(); | |
| 236 | + | |
| 237 | +        $nodesWithStyleAttributes = $xpath->query('//*[@style]'); | |
| 238 | +        if ($nodesWithStyleAttributes !== false) { | |
| 239 | + /** @var $nodeWithStyleAttribute DOMNode */ | |
| 240 | +            foreach ($nodesWithStyleAttributes as $node) { | |
| 241 | +                $normalizedOriginalStyle = preg_replace_callback( '/[A-z\\-]+(?=\\:)/S', array( $this, 'strtolower' ), $node->getAttribute('style') ); | |
| 242 | + | |
| 243 | + // in order to not overwrite existing style attributes in the HTML, we have to save the original HTML styles | |
| 244 | + $nodePath = $node->getNodePath(); | |
| 245 | +                if (!isset($this->styleAttributesForNodes[$nodePath])) { | |
| 246 | + $this->styleAttributesForNodes[$nodePath] = $this->parseCssDeclarationBlock($normalizedOriginalStyle); | |
| 247 | + $this->visitedNodes[$nodePath] = $node; | |
| 248 | + } | |
| 249 | + | |
| 250 | +                $node->setAttribute('style', $normalizedOriginalStyle); | |
| 251 | + } | |
| 252 | + } | |
| 253 | + | |
| 254 | + // grab any existing style blocks from the html and append them to the existing CSS | |
| 255 | + // (these blocks should be appended so as to have precedence over conflicting styles in the existing CSS) | |
| 256 | + $allCss = $this->css; | |
| 257 | + | |
| 258 | + $allCss .= $this->getCssFromAllStyleNodes($xpath); | |
| 259 | + | |
| 260 | + $cssParts = $this->splitCssAndMediaQuery($allCss); | |
| 261 | + self::$_media = ''; // reset | |
| 262 | + | |
| 263 | + $cssKey = md5($cssParts['css']); | |
| 264 | +        if (!isset($this->caches[self::CACHE_KEY_CSS][$cssKey])) { | |
| 265 | + // process the CSS file for selectors and definitions | |
| 266 | +            preg_match_all('/(?:^|[\\s^{}]*)([^{]+){([^}]*)}/mis', $cssParts['css'], $matches, PREG_SET_ORDER); | |
| 267 | + | |
| 268 | + $allSelectors = array(); | |
| 269 | +            foreach ($matches as $key => $selectorString) { | |
| 270 | + // if there is a blank definition, skip | |
| 271 | +                if (!strlen(trim($selectorString[2]))) { | |
| 272 | + continue; | |
| 273 | + } | |
| 274 | + | |
| 275 | + // else split by commas and duplicate attributes so we can sort by selector precedence | |
| 276 | +                $selectors = explode(',', $selectorString[1]); | |
| 277 | +                foreach ($selectors as $selector) { | |
| 278 | + // don't process pseudo-elements and behavioral (dynamic) pseudo-classes; ONLY allow structural pseudo-classes | |
| 279 | +                    if (strpos($selector, ':') !== false && !preg_match('/:\\S+\\-(child|type)\\(/i', $selector)) { | |
| 280 | + continue; | |
| 281 | + } | |
| 282 | + | |
| 283 | +                    $allSelectors[] = array('selector' => trim($selector), | |
| 284 | + 'attributes' => trim($selectorString[2]), | |
| 285 | + // keep track of where it appears in the file, since order is important | |
| 286 | + 'line' => $key, | |
| 287 | + ); | |
| 288 | + } | |
| 289 | + } | |
| 290 | + | |
| 291 | + // now sort the selectors by precedence | |
| 292 | + usort($allSelectors, array($this,'sortBySelectorPrecedence')); | |
| 293 | + | |
| 294 | + $this->caches[self::CACHE_KEY_CSS][$cssKey] = $allSelectors; | |
| 295 | + } | |
| 296 | + | |
| 297 | +        foreach ($this->caches[self::CACHE_KEY_CSS][$cssKey] as $value) { | |
| 298 | + // query the body for the xpath selector | |
| 299 | + $nodesMatchingCssSelectors = $xpath->query($this->translateCssToXpath($value['selector'])); | |
| 300 | + | |
| 301 | + /** @var $node \DOMNode */ | |
| 302 | +            foreach ($nodesMatchingCssSelectors as $node) { | |
| 303 | + // if it has a style attribute, get it, process it, and append (overwrite) new stuff | |
| 304 | +                if ($node->hasAttribute('style')) { | |
| 305 | + // break it up into an associative array | |
| 306 | +                    $oldStyleDeclarations = $this->parseCssDeclarationBlock($node->getAttribute('style')); | |
| 307 | +                } else { | |
| 308 | + $oldStyleDeclarations = array(); | |
| 309 | + } | |
| 310 | + $newStyleDeclarations = $this->parseCssDeclarationBlock($value['attributes']); | |
| 311 | +                $node->setAttribute('style', $this->generateStyleStringFromDeclarationsArrays($oldStyleDeclarations, $newStyleDeclarations)); | |
| 312 | + } | |
| 313 | + } | |
| 314 | + | |
| 315 | + // now iterate through the nodes that contained inline styles in the original HTML | |
| 316 | +        foreach ($this->styleAttributesForNodes as $nodePath => $styleAttributesForNode) { | |
| 317 | + $node = $this->visitedNodes[$nodePath]; | |
| 318 | +            $currentStyleAttributes = $this->parseCssDeclarationBlock($node->getAttribute('style')); | |
| 319 | +            $node->setAttribute('style', $this->generateStyleStringFromDeclarationsArrays($currentStyleAttributes, $styleAttributesForNode)); | |
| 320 | + } | |
| 321 | + | |
| 322 | + // This removes styles from your email that contain display:none. | |
| 323 | + // We need to look for display:none, but we need to do a case-insensitive search. Since DOMDocument only supports XPath 1.0, | |
| 324 | + // lower-case() isn't available to us. We've thus far only set attributes to lowercase, not attribute values. Consequently, we need | |
| 325 | +        // to translate() the letters that would be in 'NONE' ("NOE") to lowercase. | |
| 326 | +        $nodesWithStyleDisplayNone = $xpath->query('//*[contains(translate(translate(@style," ",""),"NOE","noe"),"display:none")]'); | |
| 327 | + // The checks on parentNode and is_callable below ensure that if we've deleted the parent node, | |
| 328 | + // we don't try to call removeChild on a nonexistent child node | |
| 329 | +        if ($nodesWithStyleDisplayNone->length > 0) { | |
| 330 | + /** @var $node \DOMNode */ | |
| 331 | +            foreach ($nodesWithStyleDisplayNone as $node) { | |
| 332 | +                if ($node->parentNode && is_callable(array($node->parentNode,'removeChild'))) { | |
| 333 | + $node->parentNode->removeChild($node); | |
| 334 | + } | |
| 335 | + } | |
| 336 | + } | |
| 337 | + | |
| 338 | + $this->copyCssWithMediaToStyleNode($cssParts, $xmlDocument); | |
| 339 | + | |
| 340 | +        if ($this->preserveEncoding) { | |
| 341 | +            if ( function_exists( 'mb_convert_encoding' ) ) { | |
| 342 | + return mb_convert_encoding( $xmlDocument->saveHTML(), self::ENCODING, 'HTML-ENTITIES' ); | |
| 343 | +            } else { | |
| 344 | + return htmlspecialchars_decode( utf8_encode( html_entity_decode( $xmlDocument->saveHTML(), ENT_COMPAT, self::ENCODING ) ) ); | |
| 345 | + } | |
| 346 | +        } else { | |
| 347 | + return $xmlDocument->saveHTML(); | |
| 348 | + } | |
| 349 | + } | |
| 350 | + | |
| 351 | +    public function strtolower(array $m) { | |
| 352 | + return strtolower($m[0]); | |
| 353 | + } | |
| 354 | + | |
| 355 | + | |
| 356 | + /** | |
| 357 | + * This method merges old or existing name/value array with new name/value array. | |
| 358 | + * and then generates a string of the combined style suitable for placing inline. | |
| 359 | + * This becomes the single point for CSS string generation allowing for consistent. | |
| 360 | + * CSS output no matter where the CSS originally came from. | |
| 361 | + * @param array $oldStyles | |
| 362 | + * @param array $newStyles | |
| 363 | + * @return string | |
| 364 | + */ | |
| 365 | +    private function generateStyleStringFromDeclarationsArrays(array $oldStyles, array $newStyles) { | |
| 366 | + $combinedStyles = array_merge($oldStyles, $newStyles); | |
| 367 | + $style = ''; | |
| 368 | +        foreach ($combinedStyles as $attributeName => $attributeValue) { | |
| 369 | + $style .= (strtolower(trim($attributeName)) . ': ' . trim($attributeValue) . '; '); | |
| 370 | + } | |
| 371 | + return trim($style); | |
| 372 | + } | |
| 373 | + | |
| 374 | + | |
| 375 | + /** | |
| 376 | + * Copies the media part from CSS array parts to $xmlDocument. | |
| 377 | + * | |
| 378 | + * @param array $cssParts | |
| 379 | + * @param DOMDocument $xmlDocument | |
| 380 | + */ | |
| 381 | +    public function copyCssWithMediaToStyleNode(array $cssParts, DOMDocument $xmlDocument) { | |
| 382 | +        if (isset($cssParts['media']) && $cssParts['media'] !== '') { | |
| 383 | + $this->addStyleElementToDocument($xmlDocument, $cssParts['media']); | |
| 384 | + } | |
| 385 | + } | |
| 386 | + | |
| 387 | + /** | |
| 388 | + * Returns CSS content. | |
| 389 | + * | |
| 390 | + * @param DOMXPath $xpath | |
| 391 | + * @return string | |
| 392 | + */ | |
| 393 | +    private function getCssFromAllStyleNodes(DOMXPath $xpath) { | |
| 394 | +        $styleNodes = $xpath->query('//style'); | |
| 395 | + | |
| 396 | +        if ($styleNodes === false) { | |
| 397 | + return ''; | |
| 398 | + } | |
| 399 | + | |
| 400 | + $css = ''; | |
| 401 | + /** @var $styleNode DOMNode */ | |
| 402 | +        foreach ($styleNodes as $styleNode) { | |
| 403 | + $css .= "\n\n" . $styleNode->nodeValue; | |
| 404 | + $styleNode->parentNode->removeChild($styleNode); | |
| 405 | + } | |
| 406 | + | |
| 407 | + return $css; | |
| 408 | + } | |
| 409 | + | |
| 410 | + /** | |
| 411 | + * Adds a style element with $css to $document. | |
| 412 | + * | |
| 413 | + * @param DOMDocument $document | |
| 414 | + * @param string $css | |
| 415 | + */ | |
| 416 | +    private function addStyleElementToDocument(DOMDocument $document, $css) { | |
| 417 | +        $styleElement = $document->createElement('style', $css); | |
| 418 | +        $styleAttribute = $document->createAttribute('type'); | |
| 419 | + $styleAttribute->value = 'text/css'; | |
| 420 | + $styleElement->appendChild($styleAttribute); | |
| 421 | + | |
| 422 | + $head = $this->getOrCreateHeadElement($document); | |
| 423 | + $head->appendChild($styleElement); | |
| 424 | + } | |
| 425 | + | |
| 426 | + /** | |
| 427 | + * Returns the existing or creates a new head element in $document. | |
| 428 | + * | |
| 429 | + * @param DOMDocument $document | |
| 430 | + * @return DOMNode the head element | |
| 431 | + */ | |
| 432 | +    private function getOrCreateHeadElement(DOMDocument $document) { | |
| 433 | +        $head = $document->getElementsByTagName('head')->item(0); | |
| 434 | + | |
| 435 | +        if ($head === null) { | |
| 436 | +            $head = $document->createElement('head'); | |
| 437 | +            $html = $document->getElementsByTagName('html')->item(0); | |
| 438 | +            $html->insertBefore($head, $document->getElementsByTagName('body')->item(0)); | |
| 439 | + } | |
| 440 | + | |
| 441 | + return $head; | |
| 442 | + } | |
| 443 | + | |
| 444 | + /** | |
| 445 | + * Splits input CSS code to an array where: | |
| 446 | + * | |
| 447 | + * - key "css" will be contains clean CSS code. | |
| 448 | + * - key "media" will be contains all valuable media queries. | |
| 449 | + * | |
| 450 | + * Example: | |
| 451 | + * | |
| 452 | + * The CSS code. | |
| 453 | + * | |
| 454 | +     *   "@import "file.css"; h1 { color:red; } @media { h1 {}} @media tv { h1 {}}" | |
| 455 | + * | |
| 456 | + * will be parsed into the following array: | |
| 457 | + * | |
| 458 | +     *   "css" => "h1 { color:red; }" | |
| 459 | +     *   "media" => "@media { h1 {}}" | |
| 460 | + * | |
| 461 | + * @param string $css | |
| 462 | + * @return array | |
| 463 | + */ | |
| 464 | +    private function splitCssAndMediaQuery($css) { | |
| 465 | +        $css = preg_replace_callback( '#@media\\s+(?:only\\s)?(?:[\\s{\(]|screen|all)\\s?[^{]+{.*}\\s*}\\s*#misU', array( $this, '_media_concat' ), $css ); | |
| 466 | + | |
| 467 | + // filter the CSS | |
| 468 | + $search = array( | |
| 469 | + // get rid of css comment code | |
| 470 | + '/\\/\\*.*\\*\\//sU', | |
| 471 | + // strip out any import directives | |
| 472 | + '/^\\s*@import\\s[^;]+;/misU', | |
| 473 | + // strip remains media enclosures | |
| 474 | +            '/^\\s*@media\\s[^{]+{(.*)}\\s*}\\s/misU', | |
| 475 | + ); | |
| 476 | + | |
| 477 | + $replace = array( | |
| 478 | + '', | |
| 479 | + '', | |
| 480 | + '', | |
| 481 | + ); | |
| 482 | + | |
| 483 | + // clean CSS before output | |
| 484 | + $css = preg_replace($search, $replace, $css); | |
| 485 | + | |
| 486 | +        return array('css' => $css, 'media' => self::$_media); | |
| 487 | + } | |
| 488 | + | |
| 489 | +    private function _media_concat( $matches ) { | |
| 490 | + self::$_media .= $matches[0]; | |
| 491 | + } | |
| 492 | + | |
| 493 | + /** | |
| 494 | + * Creates a DOMDocument instance with the current HTML. | |
| 495 | + * | |
| 496 | + * @return DOMDocument | |
| 497 | + */ | |
| 498 | +    private function createXmlDocument() { | |
| 499 | + $xmlDocument = new DOMDocument; | |
| 500 | + $xmlDocument->encoding = self::ENCODING; | |
| 501 | + $xmlDocument->strictErrorChecking = false; | |
| 502 | + $xmlDocument->formatOutput = true; | |
| 503 | + $libXmlState = libxml_use_internal_errors(true); | |
| 504 | + $xmlDocument->loadHTML($this->getUnifiedHtml()); | |
| 505 | + libxml_clear_errors(); | |
| 506 | + libxml_use_internal_errors($libXmlState); | |
| 507 | + $xmlDocument->normalizeDocument(); | |
| 508 | + | |
| 509 | + return $xmlDocument; | |
| 510 | + } | |
| 511 | + | |
| 512 | + /** | |
| 513 | + * Returns the HTML with the non-ASCII characters converts into HTML entities and the unprocessable HTML tags removed. | |
| 514 | + * | |
| 515 | + * @return string the unified HTML | |
| 516 | + * | |
| 517 | + * @throws BadMethodCallException | |
| 518 | + */ | |
| 519 | +    private function getUnifiedHtml() { | |
| 520 | +        if (!empty($this->unprocessableHtmlTags)) { | |
| 521 | +            $unprocessableHtmlTags = implode('|', $this->unprocessableHtmlTags); | |
| 522 | +            $bodyWithoutUnprocessableTags = preg_replace('/<\\/?(' . $unprocessableHtmlTags . ')[^>]*>/i', '', $this->html); | |
| 523 | +        } else { | |
| 524 | + $bodyWithoutUnprocessableTags = $this->html; | |
| 525 | + } | |
| 526 | + | |
| 527 | +        if ( function_exists( 'mb_convert_encoding' ) ) { | |
| 528 | + return mb_convert_encoding( $bodyWithoutUnprocessableTags, 'HTML-ENTITIES', self::ENCODING ); | |
| 529 | +        } else { | |
| 530 | + return htmlspecialchars_decode( utf8_decode( htmlentities( $bodyWithoutUnprocessableTags, ENT_COMPAT, self::ENCODING, false ) ) ); | |
| 531 | + } | |
| 532 | + } | |
| 533 | + | |
| 534 | + /** | |
| 535 | + * @param array $a | |
| 536 | + * @param array $b | |
| 537 | + * | |
| 538 | + * @return integer | |
| 539 | + */ | |
| 540 | +    private function sortBySelectorPrecedence(array $a, array $b) { | |
| 541 | + $precedenceA = $this->getCssSelectorPrecedence($a['selector']); | |
| 542 | + $precedenceB = $this->getCssSelectorPrecedence($b['selector']); | |
| 543 | + | |
| 544 | + // We want these sorted in ascending order so selectors with lesser precedence get processed first and | |
| 545 | + // selectors with greater precedence get sorted last. | |
| 546 | + // The parenthesis around the -1 are necessary to avoid a PHP_CodeSniffer warning about missing spaces around | |
| 547 | + // arithmetic operators. | |
| 548 | + // @see http://forge.typo3.org/issues/55605 | |
| 549 | + $precedenceForEquals = ($a['line'] < $b['line'] ? (-1) : 1); | |
| 550 | + $precedenceForNotEquals = ($precedenceA < $precedenceB ? (-1) : 1); | |
| 551 | + return ($precedenceA === $precedenceB) ? $precedenceForEquals : $precedenceForNotEquals; | |
| 552 | + } | |
| 553 | + | |
| 554 | + /** | |
| 555 | + * @param string $selector | |
| 556 | + * | |
| 557 | + * @return integer | |
| 558 | + */ | |
| 559 | +    private function getCssSelectorPrecedence($selector) { | |
| 560 | + $selectorKey = md5($selector); | |
| 561 | +        if (!isset($this->caches[self::CACHE_KEY_SELECTOR][$selectorKey])) { | |
| 562 | + $precedence = 0; | |
| 563 | + $value = 100; | |
| 564 | + // ids: worth 100, classes: worth 10, elements: worth 1 | |
| 565 | +            $search = array('\\#','\\.',''); | |
| 566 | + | |
| 567 | +            foreach ($search as $s) { | |
| 568 | +                if (trim($selector == '')) { | |
| 569 | + break; | |
| 570 | + } | |
| 571 | + $number = 0; | |
| 572 | +                $selector = preg_replace('/' . $s . '\\w+/', '', $selector, -1, $number); | |
| 573 | + $precedence += ($value * $number); | |
| 574 | + $value /= 10; | |
| 575 | + } | |
| 576 | + $this->caches[self::CACHE_KEY_SELECTOR][$selectorKey] = $precedence; | |
| 577 | + } | |
| 578 | + | |
| 579 | + return $this->caches[self::CACHE_KEY_SELECTOR][$selectorKey]; | |
| 580 | + } | |
| 581 | + | |
| 582 | + /** | |
| 583 | + * Right now, we support all CSS 1 selectors and most CSS2/3 selectors. | |
| 584 | + * | |
| 585 | + * @see http://plasmasturm.org/log/444/ | |
| 586 | + * | |
| 587 | + * @param string $paramCssSelector | |
| 588 | + * | |
| 589 | + * @return string | |
| 590 | + */ | |
| 591 | +    private function translateCssToXpath($paramCssSelector) { | |
| 592 | + $cssSelector = ' ' . $paramCssSelector . ' '; | |
| 593 | + $cssSelector = preg_replace_callback( '/\s+\w+\s+/', array( $this, 'strtolower' ), $cssSelector ); | |
| 594 | + $cssSelector = trim($cssSelector); | |
| 595 | + $xpathKey = md5($cssSelector); | |
| 596 | +        if (!isset($this->caches[self::CACHE_KEY_XPATH][$xpathKey])) { | |
| 597 | + // returns an Xpath selector | |
| 598 | + $search = array( | |
| 599 | + // Matches any element that is a child of parent. | |
| 600 | + '/\\s+>\\s+/', | |
| 601 | + // Matches any element that is an adjacent sibling. | |
| 602 | + '/\\s+\\+\\s+/', | |
| 603 | + // Matches any element that is a descendant of an parent element element. | |
| 604 | + '/\\s+/', | |
| 605 | + // first-child pseudo-selector | |
| 606 | + '/([^\\/]+):first-child/i', | |
| 607 | + // last-child pseudo-selector | |
| 608 | + '/([^\\/]+):last-child/i', | |
| 609 | + // Matches attribute only selector | |
| 610 | + '/^\\[(\\w+)\\]/', | |
| 611 | + // Matches element with attribute | |
| 612 | + '/(\\w)\\[(\\w+)\\]/', | |
| 613 | + // Matches element with EXACT attribute | |
| 614 | + '/(\\w)\\[(\\w+)\\=[\'"]?(\\w+)[\'"]?\\]/', | |
| 615 | + ); | |
| 616 | + $replace = array( | |
| 617 | + '/', | |
| 618 | + '/following-sibling::*[1]/self::', | |
| 619 | + '//', | |
| 620 | + '*[1]/self::\\1', | |
| 621 | + '*[last()]/self::\\1', | |
| 622 | + '*[@\\1]', | |
| 623 | + '\\1[@\\2]', | |
| 624 | + '\\1[@\\2="\\3"]', | |
| 625 | + ); | |
| 626 | + | |
| 627 | + $cssSelector = '//' . preg_replace($search, $replace, $cssSelector); | |
| 628 | + | |
| 629 | + $cssSelector = preg_replace_callback(self::ID_ATTRIBUTE_MATCHER, array($this, 'matchIdAttributes'), $cssSelector); | |
| 630 | + $cssSelector = preg_replace_callback(self::CLASS_ATTRIBUTE_MATCHER, array($this, 'matchClassAttributes'), $cssSelector); | |
| 631 | + | |
| 632 | + // Advanced selectors are going to require a bit more advanced emogrification. | |
| 633 | + // When we required PHP 5.3, we could do this with closures. | |
| 634 | + $cssSelector = preg_replace_callback( | |
| 635 | + '/([^\\/]+):nth-child\\(\s*(odd|even|[+\-]?\\d|[+\\-]?\\d?n(\\s*[+\\-]\\s*\\d)?)\\s*\\)/i', | |
| 636 | + array($this, 'translateNthChild'), $cssSelector | |
| 637 | + ); | |
| 638 | + $cssSelector = preg_replace_callback( | |
| 639 | + '/([^\\/]+):nth-of-type\\(\s*(odd|even|[+\-]?\\d|[+\\-]?\\d?n(\\s*[+\\-]\\s*\\d)?)\\s*\\)/i', | |
| 640 | + array($this, 'translateNthOfType'), $cssSelector | |
| 641 | + ); | |
| 642 | + | |
| 643 | + $this->caches[self::CACHE_KEY_SELECTOR][$xpathKey] = $cssSelector; | |
| 644 | + } | |
| 645 | + return $this->caches[self::CACHE_KEY_SELECTOR][$xpathKey]; | |
| 646 | + } | |
| 647 | + | |
| 648 | + /** | |
| 649 | + * @param array $match | |
| 650 | + * | |
| 651 | + * @return string | |
| 652 | + */ | |
| 653 | +    private function matchIdAttributes(array $match) { | |
| 654 | + return (strlen($match[1]) ? $match[1] : '*') . '[@id="' . $match[2] . '"]'; | |
| 655 | + } | |
| 656 | + | |
| 657 | + /** | |
| 658 | + * @param array $match | |
| 659 | + * | |
| 660 | + * @return string | |
| 661 | + */ | |
| 662 | +    private function matchClassAttributes(array $match) { | |
| 663 | +        return (strlen($match[1]) ? $match[1] : '*') . '[contains(concat(" ",@class," "),concat(" ","' . | |
| 664 | + implode( | |
| 665 | +                '"," "))][contains(concat(" ",@class," "),concat(" ","', | |
| 666 | +                explode('.', substr($match[2], 1)) | |
| 667 | + ) . '"," "))]'; | |
| 668 | + } | |
| 669 | + | |
| 670 | + /** | |
| 671 | + * @param array $match | |
| 672 | + * | |
| 673 | + * @return string | |
| 674 | + */ | |
| 675 | +    private function translateNthChild(array $match) { | |
| 676 | + $result = $this->parseNth($match); | |
| 677 | + | |
| 678 | +        if (isset($result[self::MULTIPLIER])) { | |
| 679 | +            if ($result[self::MULTIPLIER] < 0) { | |
| 680 | + $result[self::MULTIPLIER] = abs($result[self::MULTIPLIER]); | |
| 681 | +                return sprintf('*[(last() - position()) mod %u = %u]/self::%s', $result[self::MULTIPLIER], $result[self::INDEX], $match[1]); | |
| 682 | +            } else { | |
| 683 | +                return sprintf('*[position() mod %u = %u]/self::%s', $result[self::MULTIPLIER], $result[self::INDEX], $match[1]); | |
| 684 | + } | |
| 685 | +        } else { | |
| 686 | +            return sprintf('*[%u]/self::%s', $result[self::INDEX], $match[1]); | |
| 687 | + } | |
| 688 | + } | |
| 689 | + | |
| 690 | + /** | |
| 691 | + * @param array $match | |
| 692 | + * | |
| 693 | + * @return string | |
| 694 | + */ | |
| 695 | +    private function translateNthOfType(array $match) { | |
| 696 | + $result = $this->parseNth($match); | |
| 697 | + | |
| 698 | +        if (isset($result[self::MULTIPLIER])) { | |
| 699 | +            if ($result[self::MULTIPLIER] < 0) { | |
| 700 | + $result[self::MULTIPLIER] = abs($result[self::MULTIPLIER]); | |
| 701 | +                return sprintf('%s[(last() - position()) mod %u = %u]', $match[1], $result[self::MULTIPLIER], $result[self::INDEX]); | |
| 702 | +            } else { | |
| 703 | +                return sprintf('%s[position() mod %u = %u]', $match[1], $result[self::MULTIPLIER], $result[self::INDEX]); | |
| 704 | + } | |
| 705 | +        } else { | |
| 706 | +            return sprintf('%s[%u]', $match[1], $result[self::INDEX]); | |
| 707 | + } | |
| 708 | + } | |
| 709 | + | |
| 710 | + /** | |
| 711 | + * @param array $match | |
| 712 | + * | |
| 713 | + * @return array | |
| 714 | + */ | |
| 715 | +    private function parseNth(array $match) { | |
| 716 | +        if (in_array(strtolower($match[2]), array('even','odd'))) { | |
| 717 | + $index = strtolower($match[2]) == 'even' ? 0 : 1; | |
| 718 | + return array(self::MULTIPLIER => 2, self::INDEX => $index); | |
| 719 | +        } elseif (stripos($match[2], 'n') === false) { | |
| 720 | + // if there is a multiplier | |
| 721 | +            $index = intval(str_replace(' ', '', $match[2])); | |
| 722 | + return array(self::INDEX => $index); | |
| 723 | +        } else { | |
| 724 | +            if (isset($match[3])) { | |
| 725 | + $multipleTerm = str_replace($match[3], '', $match[2]); | |
| 726 | +                $index = intval(str_replace(' ', '', $match[3])); | |
| 727 | +            } else { | |
| 728 | + $multipleTerm = $match[2]; | |
| 729 | + $index = 0; | |
| 730 | + } | |
| 731 | + | |
| 732 | +            $multiplier = str_ireplace('n', '', $multipleTerm); | |
| 733 | + | |
| 734 | +            if (!strlen($multiplier)) { | |
| 735 | + $multiplier = 1; | |
| 736 | +            } elseif ($multiplier == 0) { | |
| 737 | + return array(self::INDEX => $index); | |
| 738 | +            } else { | |
| 739 | + $multiplier = intval($multiplier); | |
| 740 | + } | |
| 741 | + | |
| 742 | +            while ($index < 0) { | |
| 743 | + $index += abs($multiplier); | |
| 744 | + } | |
| 745 | + | |
| 746 | + return array(self::MULTIPLIER => $multiplier, self::INDEX => $index); | |
| 747 | + } | |
| 748 | + } | |
| 749 | + | |
| 750 | + /** | |
| 751 | + * Parses a CSS declaration block into property name/value pairs. | |
| 752 | + * | |
| 753 | + * Example: | |
| 754 | + * | |
| 755 | + * The declaration block. | |
| 756 | + * | |
| 757 | + * "color: #000; font-weight: bold;". | |
| 758 | + * | |
| 759 | + * will be parsed into the following array: | |
| 760 | + * | |
| 761 | + * "color" => "#000" | |
| 762 | + * "font-weight" => "bold" | |
| 763 | + * | |
| 764 | + * @param string $cssDeclarationBlock the CSS declaration block without the curly braces, may be empty | |
| 765 | + * | |
| 766 | + * @return array the CSS declarations with the property names as array keys and the property values as array values | |
| 767 | + */ | |
| 768 | +    private function parseCssDeclarationBlock($cssDeclarationBlock) { | |
| 769 | +        if (isset($this->caches[self::CACHE_KEY_CSS_DECLARATION_BLOCK][$cssDeclarationBlock])) { | |
| 770 | + return $this->caches[self::CACHE_KEY_CSS_DECLARATION_BLOCK][$cssDeclarationBlock]; | |
| 771 | + } | |
| 772 | + | |
| 773 | + $properties = array(); | |
| 774 | +        $declarations = explode(';', $cssDeclarationBlock); | |
| 775 | +        foreach ($declarations as $declaration) { | |
| 776 | + $matches = array(); | |
| 777 | +            if (!preg_match('/ *([A-Za-z\\-]+) *: *([^;]+) */', $declaration, $matches)) { | |
| 778 | + continue; | |
| 779 | + } | |
| 780 | + $propertyName = strtolower($matches[1]); | |
| 781 | + $propertyValue = $matches[2]; | |
| 782 | + $properties[$propertyName] = $propertyValue; | |
| 783 | + } | |
| 784 | + $this->caches[self::CACHE_KEY_CSS_DECLARATION_BLOCK][$cssDeclarationBlock] = $properties; | |
| 785 | + | |
| 786 | + return $properties; | |
| 787 | + } | |
| 788 | 788 | } | 
| @@ -5,237 +5,237 @@ | ||
| 5 | 5 | |
| 6 | 6 |  abstract class Wpinv_DB { | 
| 7 | 7 | |
| 8 | - /** | |
| 9 | - * The name of our database table | |
| 10 | - * | |
| 11 | - * @access public | |
| 12 | - * @since 1.0.0 | |
| 13 | - */ | |
| 14 | - public $table_name; | |
| 15 | - | |
| 16 | - /** | |
| 17 | - * The version of our database table | |
| 18 | - * | |
| 19 | - * @access public | |
| 20 | - * @since 1.0.0 | |
| 21 | - */ | |
| 22 | - public $version; | |
| 23 | - | |
| 24 | - /** | |
| 25 | - * The name of the primary column | |
| 26 | - * | |
| 27 | - * @access public | |
| 28 | - * @since 1.0.0 | |
| 29 | - */ | |
| 30 | - public $primary_key; | |
| 31 | - | |
| 32 | - /** | |
| 33 | - * Get things started | |
| 34 | - * | |
| 35 | - * @access public | |
| 36 | - * @since 1.0.0 | |
| 37 | - */ | |
| 38 | -	public function __construct() {} | |
| 39 | - | |
| 40 | - /** | |
| 41 | - * Whitelist of columns | |
| 42 | - * | |
| 43 | - * @access public | |
| 44 | - * @since 1.0.0 | |
| 45 | - * @return array | |
| 46 | - */ | |
| 47 | -	public function get_columns() { | |
| 48 | - return array(); | |
| 49 | - } | |
| 50 | - | |
| 51 | - /** | |
| 52 | - * Default column values | |
| 53 | - * | |
| 54 | - * @access public | |
| 55 | - * @since 1.0.0 | |
| 56 | - * @return array | |
| 57 | - */ | |
| 58 | -	public function get_column_defaults() { | |
| 59 | - return array(); | |
| 60 | - } | |
| 61 | - | |
| 62 | - /** | |
| 63 | - * Retrieve a row by the primary key | |
| 64 | - * | |
| 65 | - * @access public | |
| 66 | - * @since 1.0.0 | |
| 67 | - * @return object | |
| 68 | - */ | |
| 69 | -	public function get( $row_id ) { | |
| 70 | - global $wpdb; | |
| 71 | - return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ); | |
| 72 | - } | |
| 73 | - | |
| 74 | - /** | |
| 75 | - * Retrieve a row by a specific column / value | |
| 76 | - * | |
| 77 | - * @access public | |
| 78 | - * @since 1.0.0 | |
| 79 | - * @return object | |
| 80 | - */ | |
| 81 | -	public function get_by( $column, $row_id ) { | |
| 82 | - global $wpdb; | |
| 83 | - $column = esc_sql( $column ); | |
| 84 | - return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id ) ); | |
| 85 | - } | |
| 86 | - | |
| 87 | - /** | |
| 88 | - * Retrieve a specific column's value by the primary key | |
| 89 | - * | |
| 90 | - * @access public | |
| 91 | - * @since 1.0.0 | |
| 92 | - * @return string | |
| 93 | - */ | |
| 94 | -	public function get_column( $column, $row_id ) { | |
| 95 | - global $wpdb; | |
| 96 | - $column = esc_sql( $column ); | |
| 97 | - return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ); | |
| 98 | - } | |
| 99 | - | |
| 100 | - /** | |
| 101 | - * Retrieve a specific column's value by the the specified column / value | |
| 102 | - * | |
| 103 | - * @access public | |
| 104 | - * @since 1.0.0 | |
| 105 | - * @return string | |
| 106 | - */ | |
| 107 | -	public function get_column_by( $column, $column_where, $column_value ) { | |
| 108 | - global $wpdb; | |
| 109 | - $column_where = esc_sql( $column_where ); | |
| 110 | - $column = esc_sql( $column ); | |
| 111 | - return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value ) ); | |
| 112 | - } | |
| 113 | - | |
| 114 | - /** | |
| 115 | - * Insert a new row | |
| 116 | - * | |
| 117 | - * @access public | |
| 118 | - * @since 1.0.0 | |
| 119 | - * @return int | |
| 120 | - */ | |
| 121 | -	public function insert( $data, $type = '' ) { | |
| 122 | - global $wpdb; | |
| 123 | - | |
| 124 | - // Set default values | |
| 125 | - $data = wp_parse_args( $data, $this->get_column_defaults() ); | |
| 126 | - | |
| 127 | - do_action( 'wpinv_pre_insert_' . $type, $data ); | |
| 128 | - | |
| 129 | - // Initialise column format array | |
| 130 | - $column_formats = $this->get_columns(); | |
| 131 | - | |
| 132 | - // Force fields to lower case | |
| 133 | - $data = array_change_key_case( $data ); | |
| 134 | - | |
| 135 | - // White list columns | |
| 136 | - $data = array_intersect_key( $data, $column_formats ); | |
| 137 | - | |
| 138 | - // Reorder $column_formats to match the order of columns given in $data | |
| 139 | - $data_keys = array_keys( $data ); | |
| 140 | - $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); | |
| 141 | - | |
| 142 | - $wpdb->insert( $this->table_name, $data, $column_formats ); | |
| 143 | - $wpdb_insert_id = $wpdb->insert_id; | |
| 144 | - | |
| 145 | - do_action( 'wpinv_post_insert_' . $type, $wpdb_insert_id, $data ); | |
| 146 | - | |
| 147 | - return $wpdb_insert_id; | |
| 148 | - } | |
| 149 | - | |
| 150 | - /** | |
| 151 | - * Update a row | |
| 152 | - * | |
| 153 | - * @access public | |
| 154 | - * @since 1.0.0 | |
| 155 | - * @return bool | |
| 156 | - */ | |
| 157 | -	public function update( $row_id, $data = array(), $where = '' ) { | |
| 158 | - | |
| 159 | - global $wpdb; | |
| 160 | - | |
| 161 | - // Row ID must be positive integer | |
| 162 | - $row_id = absint( $row_id ); | |
| 163 | - | |
| 164 | -		if( empty( $row_id ) ) { | |
| 165 | - return false; | |
| 166 | - } | |
| 167 | - | |
| 168 | -		if( empty( $where ) ) { | |
| 169 | - $where = $this->primary_key; | |
| 170 | - } | |
| 171 | - | |
| 172 | - // Initialise column format array | |
| 173 | - $column_formats = $this->get_columns(); | |
| 174 | - | |
| 175 | - // Force fields to lower case | |
| 176 | - $data = array_change_key_case( $data ); | |
| 177 | - | |
| 178 | - // White list columns | |
| 179 | - $data = array_intersect_key( $data, $column_formats ); | |
| 180 | - | |
| 181 | - // Reorder $column_formats to match the order of columns given in $data | |
| 182 | - $data_keys = array_keys( $data ); | |
| 183 | - $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); | |
| 184 | - | |
| 185 | -		if ( false === $wpdb->update( $this->table_name, $data, array( $where => $row_id ), $column_formats ) ) { | |
| 186 | - return false; | |
| 187 | - } | |
| 188 | - | |
| 189 | - return true; | |
| 190 | - } | |
| 191 | - | |
| 192 | - /** | |
| 193 | - * Delete a row identified by the primary key | |
| 194 | - * | |
| 195 | - * @access public | |
| 196 | - * @since 1.0.0 | |
| 197 | - * @return bool | |
| 198 | - */ | |
| 199 | -	public function delete( $row_id = 0 ) { | |
| 200 | - | |
| 201 | - global $wpdb; | |
| 202 | - | |
| 203 | - // Row ID must be positive integer | |
| 204 | - $row_id = absint( $row_id ); | |
| 205 | - | |
| 206 | -		if( empty( $row_id ) ) { | |
| 207 | - return false; | |
| 208 | - } | |
| 209 | - | |
| 210 | -		if ( false === $wpdb->query( $wpdb->prepare( "DELETE FROM $this->table_name WHERE $this->primary_key = %d", $row_id ) ) ) { | |
| 211 | - return false; | |
| 212 | - } | |
| 213 | - | |
| 214 | - return true; | |
| 215 | - } | |
| 216 | - | |
| 217 | - /** | |
| 218 | - * Check if the given table exists | |
| 219 | - * | |
| 220 | - * @since 2.4 | |
| 221 | - * @param string $table The table name | |
| 222 | - * @return bool If the table name exists | |
| 223 | - */ | |
| 224 | -	public function table_exists( $table ) { | |
| 225 | - global $wpdb; | |
| 226 | - $table = sanitize_text_field( $table ); | |
| 227 | - | |
| 228 | - return $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $table ) ) === $table; | |
| 229 | - } | |
| 230 | - | |
| 231 | - /** | |
| 232 | - * Check if the table was ever installed | |
| 233 | - * | |
| 234 | - * @since 2.4 | |
| 235 | - * @return bool Returns if the customers table was installed and upgrade routine run | |
| 236 | - */ | |
| 237 | -	public function installed() { | |
| 238 | - return $this->table_exists( $this->table_name ); | |
| 239 | - } | |
| 8 | + /** | |
| 9 | + * The name of our database table | |
| 10 | + * | |
| 11 | + * @access public | |
| 12 | + * @since 1.0.0 | |
| 13 | + */ | |
| 14 | + public $table_name; | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * The version of our database table | |
| 18 | + * | |
| 19 | + * @access public | |
| 20 | + * @since 1.0.0 | |
| 21 | + */ | |
| 22 | + public $version; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * The name of the primary column | |
| 26 | + * | |
| 27 | + * @access public | |
| 28 | + * @since 1.0.0 | |
| 29 | + */ | |
| 30 | + public $primary_key; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * Get things started | |
| 34 | + * | |
| 35 | + * @access public | |
| 36 | + * @since 1.0.0 | |
| 37 | + */ | |
| 38 | +    public function __construct() {} | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * Whitelist of columns | |
| 42 | + * | |
| 43 | + * @access public | |
| 44 | + * @since 1.0.0 | |
| 45 | + * @return array | |
| 46 | + */ | |
| 47 | +    public function get_columns() { | |
| 48 | + return array(); | |
| 49 | + } | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * Default column values | |
| 53 | + * | |
| 54 | + * @access public | |
| 55 | + * @since 1.0.0 | |
| 56 | + * @return array | |
| 57 | + */ | |
| 58 | +    public function get_column_defaults() { | |
| 59 | + return array(); | |
| 60 | + } | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * Retrieve a row by the primary key | |
| 64 | + * | |
| 65 | + * @access public | |
| 66 | + * @since 1.0.0 | |
| 67 | + * @return object | |
| 68 | + */ | |
| 69 | +    public function get( $row_id ) { | |
| 70 | + global $wpdb; | |
| 71 | + return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ); | |
| 72 | + } | |
| 73 | + | |
| 74 | + /** | |
| 75 | + * Retrieve a row by a specific column / value | |
| 76 | + * | |
| 77 | + * @access public | |
| 78 | + * @since 1.0.0 | |
| 79 | + * @return object | |
| 80 | + */ | |
| 81 | +    public function get_by( $column, $row_id ) { | |
| 82 | + global $wpdb; | |
| 83 | + $column = esc_sql( $column ); | |
| 84 | + return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id ) ); | |
| 85 | + } | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * Retrieve a specific column's value by the primary key | |
| 89 | + * | |
| 90 | + * @access public | |
| 91 | + * @since 1.0.0 | |
| 92 | + * @return string | |
| 93 | + */ | |
| 94 | +    public function get_column( $column, $row_id ) { | |
| 95 | + global $wpdb; | |
| 96 | + $column = esc_sql( $column ); | |
| 97 | + return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ); | |
| 98 | + } | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * Retrieve a specific column's value by the the specified column / value | |
| 102 | + * | |
| 103 | + * @access public | |
| 104 | + * @since 1.0.0 | |
| 105 | + * @return string | |
| 106 | + */ | |
| 107 | +    public function get_column_by( $column, $column_where, $column_value ) { | |
| 108 | + global $wpdb; | |
| 109 | + $column_where = esc_sql( $column_where ); | |
| 110 | + $column = esc_sql( $column ); | |
| 111 | + return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value ) ); | |
| 112 | + } | |
| 113 | + | |
| 114 | + /** | |
| 115 | + * Insert a new row | |
| 116 | + * | |
| 117 | + * @access public | |
| 118 | + * @since 1.0.0 | |
| 119 | + * @return int | |
| 120 | + */ | |
| 121 | +    public function insert( $data, $type = '' ) { | |
| 122 | + global $wpdb; | |
| 123 | + | |
| 124 | + // Set default values | |
| 125 | + $data = wp_parse_args( $data, $this->get_column_defaults() ); | |
| 126 | + | |
| 127 | + do_action( 'wpinv_pre_insert_' . $type, $data ); | |
| 128 | + | |
| 129 | + // Initialise column format array | |
| 130 | + $column_formats = $this->get_columns(); | |
| 131 | + | |
| 132 | + // Force fields to lower case | |
| 133 | + $data = array_change_key_case( $data ); | |
| 134 | + | |
| 135 | + // White list columns | |
| 136 | + $data = array_intersect_key( $data, $column_formats ); | |
| 137 | + | |
| 138 | + // Reorder $column_formats to match the order of columns given in $data | |
| 139 | + $data_keys = array_keys( $data ); | |
| 140 | + $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); | |
| 141 | + | |
| 142 | + $wpdb->insert( $this->table_name, $data, $column_formats ); | |
| 143 | + $wpdb_insert_id = $wpdb->insert_id; | |
| 144 | + | |
| 145 | + do_action( 'wpinv_post_insert_' . $type, $wpdb_insert_id, $data ); | |
| 146 | + | |
| 147 | + return $wpdb_insert_id; | |
| 148 | + } | |
| 149 | + | |
| 150 | + /** | |
| 151 | + * Update a row | |
| 152 | + * | |
| 153 | + * @access public | |
| 154 | + * @since 1.0.0 | |
| 155 | + * @return bool | |
| 156 | + */ | |
| 157 | +    public function update( $row_id, $data = array(), $where = '' ) { | |
| 158 | + | |
| 159 | + global $wpdb; | |
| 160 | + | |
| 161 | + // Row ID must be positive integer | |
| 162 | + $row_id = absint( $row_id ); | |
| 163 | + | |
| 164 | +        if( empty( $row_id ) ) { | |
| 165 | + return false; | |
| 166 | + } | |
| 167 | + | |
| 168 | +        if( empty( $where ) ) { | |
| 169 | + $where = $this->primary_key; | |
| 170 | + } | |
| 171 | + | |
| 172 | + // Initialise column format array | |
| 173 | + $column_formats = $this->get_columns(); | |
| 174 | + | |
| 175 | + // Force fields to lower case | |
| 176 | + $data = array_change_key_case( $data ); | |
| 177 | + | |
| 178 | + // White list columns | |
| 179 | + $data = array_intersect_key( $data, $column_formats ); | |
| 180 | + | |
| 181 | + // Reorder $column_formats to match the order of columns given in $data | |
| 182 | + $data_keys = array_keys( $data ); | |
| 183 | + $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); | |
| 184 | + | |
| 185 | +        if ( false === $wpdb->update( $this->table_name, $data, array( $where => $row_id ), $column_formats ) ) { | |
| 186 | + return false; | |
| 187 | + } | |
| 188 | + | |
| 189 | + return true; | |
| 190 | + } | |
| 191 | + | |
| 192 | + /** | |
| 193 | + * Delete a row identified by the primary key | |
| 194 | + * | |
| 195 | + * @access public | |
| 196 | + * @since 1.0.0 | |
| 197 | + * @return bool | |
| 198 | + */ | |
| 199 | +    public function delete( $row_id = 0 ) { | |
| 200 | + | |
| 201 | + global $wpdb; | |
| 202 | + | |
| 203 | + // Row ID must be positive integer | |
| 204 | + $row_id = absint( $row_id ); | |
| 205 | + | |
| 206 | +        if( empty( $row_id ) ) { | |
| 207 | + return false; | |
| 208 | + } | |
| 209 | + | |
| 210 | +        if ( false === $wpdb->query( $wpdb->prepare( "DELETE FROM $this->table_name WHERE $this->primary_key = %d", $row_id ) ) ) { | |
| 211 | + return false; | |
| 212 | + } | |
| 213 | + | |
| 214 | + return true; | |
| 215 | + } | |
| 216 | + | |
| 217 | + /** | |
| 218 | + * Check if the given table exists | |
| 219 | + * | |
| 220 | + * @since 2.4 | |
| 221 | + * @param string $table The table name | |
| 222 | + * @return bool If the table name exists | |
| 223 | + */ | |
| 224 | +    public function table_exists( $table ) { | |
| 225 | + global $wpdb; | |
| 226 | + $table = sanitize_text_field( $table ); | |
| 227 | + | |
| 228 | + return $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $table ) ) === $table; | |
| 229 | + } | |
| 230 | + | |
| 231 | + /** | |
| 232 | + * Check if the table was ever installed | |
| 233 | + * | |
| 234 | + * @since 2.4 | |
| 235 | + * @return bool Returns if the customers table was installed and upgrade routine run | |
| 236 | + */ | |
| 237 | +    public function installed() { | |
| 238 | + return $this->table_exists( $this->table_name ); | |
| 239 | + } | |
| 240 | 240 | |
| 241 | 241 | } | 
| @@ -15,12 +15,12 @@ | ||
| 15 | 15 | */ | 
| 16 | 16 | |
| 17 | 17 |  if ( ! defined( 'ABSPATH' ) ) { | 
| 18 | - exit; | |
| 18 | + exit; | |
| 19 | 19 | } | 
| 20 | 20 | |
| 21 | 21 |  if ( ! class_exists( 'WP_Super_Duper' ) ) { | 
| 22 | - // include the class if needed | |
| 23 | - include_once( dirname( __FILE__ ) . "/wp-super-duper.php" ); | |
| 22 | + // include the class if needed | |
| 23 | + include_once( dirname( __FILE__ ) . "/wp-super-duper.php" ); | |
| 24 | 24 | } | 
| 25 | 25 | |
| 26 | 26 | /* | 
| @@ -3,241 +3,241 @@ | ||
| 3 | 3 |  class SD_Map extends WP_Super_Duper { | 
| 4 | 4 | |
| 5 | 5 | |
| 6 | - public $arguments; | |
| 7 | - | |
| 8 | - /** | |
| 9 | - * Sets up the widgets name etc | |
| 10 | - */ | |
| 11 | -	public function __construct() { | |
| 12 | - | |
| 13 | - $options = array( | |
| 14 | - 'textdomain' => 'super-duper', | |
| 15 | - // textdomain of the plugin/theme (used to prefix the Gutenberg block) | |
| 16 | - 'block-icon' => 'admin-site', | |
| 17 | - // Dash icon name for the block: https://developer.wordpress.org/resource/dashicons/#arrow-right | |
| 18 | - 'block-category' => 'widgets', | |
| 19 | - // the category for the block, 'common', 'formatting', 'layout', 'widgets', 'embed'. | |
| 20 | - 'block-keywords' => "['map','super','google']", | |
| 21 | - // used in the block search, MAX 3 | |
| 22 | - 'block-output' => array( // the block visual output elements as an array | |
| 23 | - array( | |
| 24 | - 'element' => 'p', | |
| 25 | -					'content' => __('A Google API key is required to use this block, we recommend installing our plugin which makes it easy and sets it globally, or you can set a key in the block settings sidebar: ','super-duper'), | |
| 26 | - //'element_require' => '"1"=='.get_option( 'rgmk_google_map_api_key', '"0"') ? '"0"' : '"1"', | |
| 27 | - 'element_require' => get_option( 'rgmk_google_map_api_key', false) ? '1==0' : '1==1 && [%api_key%]==""', | |
| 28 | - ), | |
| 29 | - array( | |
| 30 | - 'element' => 'a', | |
| 31 | -					'content' => __('API KEY for Google Maps','super-duper'), | |
| 32 | - 'element_require' => get_option( 'rgmk_google_map_api_key', false) ? '1==0' : '1==1 && [%api_key%]==""', | |
| 33 | - 'href' => 'https://wordpress.org/plugins/api-key-for-google-maps/', | |
| 34 | - ), | |
| 35 | - array( | |
| 36 | - 'element' => 'img', | |
| 37 | - 'class' => '[%className%]', | |
| 38 | - //'content' => 'Hello: [%after_text%]' // block properties can be added by wrapping them in [%name%] | |
| 39 | - 'element_require' => '[%type%]=="image"', | |
| 40 | - 'src' => get_option( 'rgmk_google_map_api_key', false) ? "https://maps.googleapis.com/maps/api/staticmap?center=[%location%]&maptype=[%maptype%]&zoom=[%zoom%]&size=[%static_width%]x[%static_height%]&key=".get_option( 'rgmk_google_map_api_key') : "https://maps.googleapis.com/maps/api/staticmap?center=[%location%]&maptype=[%maptype%]&zoom=[%zoom%]&size=[%static_width%]x[%static_height%]&key=[%api_key%]" | |
| 41 | - ), | |
| 42 | - array( | |
| 43 | - 'element' => 'div', | |
| 44 | - 'class' => 'sd-map-iframe-cover', | |
| 45 | -					'style'   => '{overflow:"hidden", position:"relative"}', | |
| 46 | - array( | |
| 47 | - 'element' => 'iframe', | |
| 48 | - 'title' => __( 'Placeholderx', 'super-duper' ), | |
| 49 | - 'class' => '[%className%]', | |
| 50 | - 'width' => '[%width%]', | |
| 51 | - 'height' => '[%height%]', | |
| 52 | - 'frameborder' => '0', | |
| 53 | - 'allowfullscreen' => 'true', | |
| 54 | -						'style' => '{border:0}', | |
| 55 | - 'element_require' => '[%type%]!="image"', | |
| 56 | - 'src' => get_option( 'rgmk_google_map_api_key', false) ? "https://www.google.com/maps/embed/v1/[%type%]?q=[%location%]&maptype=[%maptype%]&zoom=[%zoom%]&key=".get_option( 'rgmk_google_map_api_key') : "https://www.google.com/maps/embed/v1/[%type%]?q=[%location%]&maptype=[%maptype%]&zoom=[%zoom%]&key=[%api_key%]" | |
| 57 | - ), | |
| 58 | - ), | |
| 59 | - array( | |
| 60 | - 'element' => 'style', | |
| 61 | -					'content' => '.sd-map-iframe-cover:hover:before {background: #4a4a4a88; content: "'.__("Click here, Settings are in the block settings sidebar","super-duper").'";} .sd-map-iframe-cover:before{cursor: pointer; content: ""; width: 100%; height: 100%; position: absolute; top: 0; bottom: 0;padding-top: 33%; text-align: center;  color: #fff; font-size: 20px; font-weight: bold;}', | |
| 62 | - 'element_require' => '[%type%]!="image"', | |
| 63 | - ), | |
| 64 | - ), | |
| 65 | - 'class_name' => __CLASS__, | |
| 66 | - // The calling class name | |
| 67 | - 'base_id' => 'sd_map', | |
| 68 | - // this is used as the widget id and the shortcode id. | |
| 69 | - 'name' => __( 'Map', 'super-duper' ), | |
| 70 | - // the name of the widget/block | |
| 71 | - 'widget_ops' => array( | |
| 72 | - 'classname' => 'sd-map-class', | |
| 73 | - // widget class | |
| 74 | - 'description' => esc_html__( 'This is an example that will take a text parameter and output it after `Hello:`.', 'hello-world' ), | |
| 75 | - // widget description | |
| 76 | - ), | |
| 77 | - 'arguments' => array( // these are the arguments that will be used in the widget, shortcode and block settings. | |
| 78 | - 'type' => array( | |
| 79 | -					'title' => __('Map Type:', 'geodirectory'), | |
| 80 | -					'desc' => __('Select the map type to use.', 'geodirectory'), | |
| 81 | - 'type' => 'select', | |
| 82 | - 'options' => array( | |
| 83 | -						"image" => __('Static Image', 'geodirectory'), | |
| 84 | -						"place" => __('Place', 'geodirectory'), | |
| 6 | + public $arguments; | |
| 7 | + | |
| 8 | + /** | |
| 9 | + * Sets up the widgets name etc | |
| 10 | + */ | |
| 11 | +    public function __construct() { | |
| 12 | + | |
| 13 | + $options = array( | |
| 14 | + 'textdomain' => 'super-duper', | |
| 15 | + // textdomain of the plugin/theme (used to prefix the Gutenberg block) | |
| 16 | + 'block-icon' => 'admin-site', | |
| 17 | + // Dash icon name for the block: https://developer.wordpress.org/resource/dashicons/#arrow-right | |
| 18 | + 'block-category' => 'widgets', | |
| 19 | + // the category for the block, 'common', 'formatting', 'layout', 'widgets', 'embed'. | |
| 20 | + 'block-keywords' => "['map','super','google']", | |
| 21 | + // used in the block search, MAX 3 | |
| 22 | + 'block-output' => array( // the block visual output elements as an array | |
| 23 | + array( | |
| 24 | + 'element' => 'p', | |
| 25 | +                    'content' => __('A Google API key is required to use this block, we recommend installing our plugin which makes it easy and sets it globally, or you can set a key in the block settings sidebar: ','super-duper'), | |
| 26 | + //'element_require' => '"1"=='.get_option( 'rgmk_google_map_api_key', '"0"') ? '"0"' : '"1"', | |
| 27 | + 'element_require' => get_option( 'rgmk_google_map_api_key', false) ? '1==0' : '1==1 && [%api_key%]==""', | |
| 28 | + ), | |
| 29 | + array( | |
| 30 | + 'element' => 'a', | |
| 31 | +                    'content' => __('API KEY for Google Maps','super-duper'), | |
| 32 | + 'element_require' => get_option( 'rgmk_google_map_api_key', false) ? '1==0' : '1==1 && [%api_key%]==""', | |
| 33 | + 'href' => 'https://wordpress.org/plugins/api-key-for-google-maps/', | |
| 34 | + ), | |
| 35 | + array( | |
| 36 | + 'element' => 'img', | |
| 37 | + 'class' => '[%className%]', | |
| 38 | + //'content' => 'Hello: [%after_text%]' // block properties can be added by wrapping them in [%name%] | |
| 39 | + 'element_require' => '[%type%]=="image"', | |
| 40 | + 'src' => get_option( 'rgmk_google_map_api_key', false) ? "https://maps.googleapis.com/maps/api/staticmap?center=[%location%]&maptype=[%maptype%]&zoom=[%zoom%]&size=[%static_width%]x[%static_height%]&key=".get_option( 'rgmk_google_map_api_key') : "https://maps.googleapis.com/maps/api/staticmap?center=[%location%]&maptype=[%maptype%]&zoom=[%zoom%]&size=[%static_width%]x[%static_height%]&key=[%api_key%]" | |
| 41 | + ), | |
| 42 | + array( | |
| 43 | + 'element' => 'div', | |
| 44 | + 'class' => 'sd-map-iframe-cover', | |
| 45 | +                    'style'   => '{overflow:"hidden", position:"relative"}', | |
| 46 | + array( | |
| 47 | + 'element' => 'iframe', | |
| 48 | + 'title' => __( 'Placeholderx', 'super-duper' ), | |
| 49 | + 'class' => '[%className%]', | |
| 50 | + 'width' => '[%width%]', | |
| 51 | + 'height' => '[%height%]', | |
| 52 | + 'frameborder' => '0', | |
| 53 | + 'allowfullscreen' => 'true', | |
| 54 | +                        'style' => '{border:0}', | |
| 55 | + 'element_require' => '[%type%]!="image"', | |
| 56 | + 'src' => get_option( 'rgmk_google_map_api_key', false) ? "https://www.google.com/maps/embed/v1/[%type%]?q=[%location%]&maptype=[%maptype%]&zoom=[%zoom%]&key=".get_option( 'rgmk_google_map_api_key') : "https://www.google.com/maps/embed/v1/[%type%]?q=[%location%]&maptype=[%maptype%]&zoom=[%zoom%]&key=[%api_key%]" | |
| 57 | + ), | |
| 58 | + ), | |
| 59 | + array( | |
| 60 | + 'element' => 'style', | |
| 61 | +                    'content' => '.sd-map-iframe-cover:hover:before {background: #4a4a4a88; content: "'.__("Click here, Settings are in the block settings sidebar","super-duper").'";} .sd-map-iframe-cover:before{cursor: pointer; content: ""; width: 100%; height: 100%; position: absolute; top: 0; bottom: 0;padding-top: 33%; text-align: center;  color: #fff; font-size: 20px; font-weight: bold;}', | |
| 62 | + 'element_require' => '[%type%]!="image"', | |
| 63 | + ), | |
| 64 | + ), | |
| 65 | + 'class_name' => __CLASS__, | |
| 66 | + // The calling class name | |
| 67 | + 'base_id' => 'sd_map', | |
| 68 | + // this is used as the widget id and the shortcode id. | |
| 69 | + 'name' => __( 'Map', 'super-duper' ), | |
| 70 | + // the name of the widget/block | |
| 71 | + 'widget_ops' => array( | |
| 72 | + 'classname' => 'sd-map-class', | |
| 73 | + // widget class | |
| 74 | + 'description' => esc_html__( 'This is an example that will take a text parameter and output it after `Hello:`.', 'hello-world' ), | |
| 75 | + // widget description | |
| 76 | + ), | |
| 77 | + 'arguments' => array( // these are the arguments that will be used in the widget, shortcode and block settings. | |
| 78 | + 'type' => array( | |
| 79 | +                    'title' => __('Map Type:', 'geodirectory'), | |
| 80 | +                    'desc' => __('Select the map type to use.', 'geodirectory'), | |
| 81 | + 'type' => 'select', | |
| 82 | + 'options' => array( | |
| 83 | +                        "image" => __('Static Image', 'geodirectory'), | |
| 84 | +                        "place" => __('Place', 'geodirectory'), | |
| 85 | 85 |  //						"directions" => __('Directions', 'geodirectory'), | 
| 86 | 86 |  //						"search" => __('Search', 'geodirectory'), | 
| 87 | 87 |  //						"view" => __('View', 'geodirectory'), | 
| 88 | 88 |  //						"streetview" => __('Streetview', 'geodirectory'), | 
| 89 | - ), | |
| 90 | - 'default' => 'image', | |
| 91 | - 'desc_tip' => true, | |
| 92 | - 'advanced' => false | |
| 93 | - ), | |
| 94 | - 'location' => array( | |
| 95 | - 'type' => 'text', | |
| 96 | - 'title' => __( 'Location:', 'geodirectory' ), | |
| 97 | - 'desc' => __( 'Enter the location to show on the map, place, city, zip code or GPS.', 'geodirectory' ), | |
| 98 | - 'placeholder' => 'Place, city, zip code or GPS', | |
| 99 | - 'desc_tip' => true, | |
| 100 | - 'default' => 'Ireland', | |
| 101 | - 'advanced' => false | |
| 102 | - ), | |
| 103 | - 'static_width' => array( | |
| 104 | - 'type' => 'number', | |
| 105 | - 'title' => __( 'Width:', 'geodirectory' ), | |
| 106 | - 'desc' => __( 'This is the width of the map, for static maps you can only use px values.', 'geodirectory' ), | |
| 107 | - 'placeholder' => '600', | |
| 108 | - 'desc_tip' => true, | |
| 109 | - 'default' => '600', | |
| 110 | - 'custom_attributes' => array( | |
| 111 | - 'max' => '2000', | |
| 112 | - 'min' => '100', | |
| 113 | - ), | |
| 114 | - 'element_require' => '[%type%]=="image"', | |
| 115 | - 'advanced' => false | |
| 116 | - ), | |
| 117 | - 'static_height' => array( | |
| 118 | - 'type' => 'number', | |
| 119 | - 'title' => __( 'Height:', 'geodirectory' ), | |
| 120 | - 'desc' => __( 'This is the height of the map, for static maps you can only use px values.', 'geodirectory' ), | |
| 121 | - 'placeholder' => '400', | |
| 122 | - 'desc_tip' => true, | |
| 123 | - 'default' => '400', | |
| 124 | - 'custom_attributes' => array( | |
| 125 | - 'max' => '2000', | |
| 126 | - 'min' => '100', | |
| 127 | - 'required' => 'required', | |
| 128 | - ), | |
| 129 | - 'element_require' => '[%type%]=="image"', | |
| 130 | - 'advanced' => false | |
| 131 | - ), | |
| 132 | - 'width' => array( | |
| 133 | - 'type' => 'text', | |
| 134 | - 'title' => __( 'Width:', 'geodirectory' ), | |
| 135 | - 'desc' => __( 'This is the width of the map, you can use % or px here.', 'geodirectory' ), | |
| 136 | - 'placeholder' => '100%', | |
| 137 | - 'desc_tip' => true, | |
| 138 | - 'default' => '100%', | |
| 139 | - 'element_require' => '[%type%]!="image"', | |
| 140 | - 'advanced' => false | |
| 141 | - ), | |
| 142 | - 'height' => array( | |
| 143 | - 'type' => 'text', | |
| 144 | - 'title' => __( 'Height:', 'geodirectory' ), | |
| 145 | - 'desc' => __( 'This is the height of the map, you can use %, px or vh here.', 'geodirectory' ), | |
| 146 | - 'placeholder' => '425px', | |
| 147 | - 'desc_tip' => true, | |
| 148 | - 'default' => '425px', | |
| 149 | - 'element_require' => '[%type%]!="image"', | |
| 150 | - 'advanced' => false | |
| 151 | - ), | |
| 152 | - 'maptype' => array( | |
| 153 | - 'type' => 'select', | |
| 154 | - 'title' => __( 'Mapview:', 'geodirectory' ), | |
| 155 | - 'desc' => __( 'This is the type of map view that will be used by default.', 'geodirectory' ), | |
| 156 | - 'options' => array( | |
| 157 | - "roadmap" => __( 'Road Map', 'geodirectory' ), | |
| 158 | - "satellite" => __( 'Satellite Map', 'geodirectory' ), | |
| 89 | + ), | |
| 90 | + 'default' => 'image', | |
| 91 | + 'desc_tip' => true, | |
| 92 | + 'advanced' => false | |
| 93 | + ), | |
| 94 | + 'location' => array( | |
| 95 | + 'type' => 'text', | |
| 96 | + 'title' => __( 'Location:', 'geodirectory' ), | |
| 97 | + 'desc' => __( 'Enter the location to show on the map, place, city, zip code or GPS.', 'geodirectory' ), | |
| 98 | + 'placeholder' => 'Place, city, zip code or GPS', | |
| 99 | + 'desc_tip' => true, | |
| 100 | + 'default' => 'Ireland', | |
| 101 | + 'advanced' => false | |
| 102 | + ), | |
| 103 | + 'static_width' => array( | |
| 104 | + 'type' => 'number', | |
| 105 | + 'title' => __( 'Width:', 'geodirectory' ), | |
| 106 | + 'desc' => __( 'This is the width of the map, for static maps you can only use px values.', 'geodirectory' ), | |
| 107 | + 'placeholder' => '600', | |
| 108 | + 'desc_tip' => true, | |
| 109 | + 'default' => '600', | |
| 110 | + 'custom_attributes' => array( | |
| 111 | + 'max' => '2000', | |
| 112 | + 'min' => '100', | |
| 113 | + ), | |
| 114 | + 'element_require' => '[%type%]=="image"', | |
| 115 | + 'advanced' => false | |
| 116 | + ), | |
| 117 | + 'static_height' => array( | |
| 118 | + 'type' => 'number', | |
| 119 | + 'title' => __( 'Height:', 'geodirectory' ), | |
| 120 | + 'desc' => __( 'This is the height of the map, for static maps you can only use px values.', 'geodirectory' ), | |
| 121 | + 'placeholder' => '400', | |
| 122 | + 'desc_tip' => true, | |
| 123 | + 'default' => '400', | |
| 124 | + 'custom_attributes' => array( | |
| 125 | + 'max' => '2000', | |
| 126 | + 'min' => '100', | |
| 127 | + 'required' => 'required', | |
| 128 | + ), | |
| 129 | + 'element_require' => '[%type%]=="image"', | |
| 130 | + 'advanced' => false | |
| 131 | + ), | |
| 132 | + 'width' => array( | |
| 133 | + 'type' => 'text', | |
| 134 | + 'title' => __( 'Width:', 'geodirectory' ), | |
| 135 | + 'desc' => __( 'This is the width of the map, you can use % or px here.', 'geodirectory' ), | |
| 136 | + 'placeholder' => '100%', | |
| 137 | + 'desc_tip' => true, | |
| 138 | + 'default' => '100%', | |
| 139 | + 'element_require' => '[%type%]!="image"', | |
| 140 | + 'advanced' => false | |
| 141 | + ), | |
| 142 | + 'height' => array( | |
| 143 | + 'type' => 'text', | |
| 144 | + 'title' => __( 'Height:', 'geodirectory' ), | |
| 145 | + 'desc' => __( 'This is the height of the map, you can use %, px or vh here.', 'geodirectory' ), | |
| 146 | + 'placeholder' => '425px', | |
| 147 | + 'desc_tip' => true, | |
| 148 | + 'default' => '425px', | |
| 149 | + 'element_require' => '[%type%]!="image"', | |
| 150 | + 'advanced' => false | |
| 151 | + ), | |
| 152 | + 'maptype' => array( | |
| 153 | + 'type' => 'select', | |
| 154 | + 'title' => __( 'Mapview:', 'geodirectory' ), | |
| 155 | + 'desc' => __( 'This is the type of map view that will be used by default.', 'geodirectory' ), | |
| 156 | + 'options' => array( | |
| 157 | + "roadmap" => __( 'Road Map', 'geodirectory' ), | |
| 158 | + "satellite" => __( 'Satellite Map', 'geodirectory' ), | |
| 159 | 159 | // "hybrid" => __( 'Hybrid Map', 'geodirectory' ), | 
| 160 | 160 | // "terrain" => __( 'Terrain Map', 'geodirectory' ), | 
| 161 | - ), | |
| 162 | - 'desc_tip' => true, | |
| 163 | - 'default' => 'roadmap', | |
| 164 | - 'advanced' => true | |
| 165 | - ), | |
| 166 | - 'zoom' => array( | |
| 167 | - 'type' => 'select', | |
| 168 | - 'title' => __( 'Zoom level:', 'geodirectory' ), | |
| 169 | - 'desc' => __( 'This is the zoom level of the map, `auto` is recommended.', 'geodirectory' ), | |
| 170 | - 'options' => range( 1, 19 ), | |
| 171 | - 'placeholder' => '', | |
| 172 | - 'desc_tip' => true, | |
| 173 | - 'default' => '7', | |
| 174 | - 'advanced' => true | |
| 175 | - ), | |
| 176 | - 'api_key' => array( | |
| 177 | - 'type' => 'text', | |
| 178 | - 'title' => __( 'Api Key:', 'geodirectory' ), | |
| 179 | - 'desc' => __( 'This is the height of the map, you can use %, px or vh here.', 'geodirectory' ), | |
| 180 | - 'placeholder' => '', | |
| 181 | - 'desc_tip' => true, | |
| 182 | - 'default' => '', | |
| 183 | - 'element_require' => get_option( 'rgmk_google_map_api_key', false) ? '1==0' : '1==1', | |
| 184 | - 'advanced' => false | |
| 185 | - ), | |
| 186 | - ) | |
| 187 | - ); | |
| 188 | - | |
| 189 | - parent::__construct( $options ); | |
| 190 | - } | |
| 191 | - | |
| 192 | - | |
| 193 | - /** | |
| 194 | - * This is the output function for the widget, shortcode and block (front end). | |
| 195 | - * | |
| 196 | - * @param array $args The arguments values. | |
| 197 | - * @param array $widget_args The widget arguments when used. | |
| 198 | - * @param string $content The shortcode content argument | |
| 199 | - * | |
| 200 | - * @return string | |
| 201 | - */ | |
| 202 | -	public function output( $args = array(), $widget_args = array(), $content = '' ) { | |
| 203 | - | |
| 204 | - // options | |
| 205 | - $defaults = array( | |
| 206 | - 'type' => 'image', // image, place | |
| 207 | - 'location' => 'Ireland', | |
| 208 | - 'static_width' => '600', | |
| 209 | - 'static_height' => '400', | |
| 210 | - 'width'=> '100%', | |
| 211 | - 'height'=> '425px', | |
| 212 | - 'maptype' => 'roadmap', | |
| 213 | - 'zoom' => '7', | |
| 214 | - 'api_key' => 'AIzaSyBK3ZcmK0ljxl5agNyJNQh_G24Thq1btuE', | |
| 215 | - ); | |
| 216 | - | |
| 217 | - /** | |
| 218 | - * Parse incoming $args into an array and merge it with $defaults | |
| 219 | - */ | |
| 220 | - $args = wp_parse_args($args, $defaults ); | |
| 221 | - | |
| 222 | - $output = ''; | |
| 223 | - | |
| 224 | - | |
| 225 | - // check if we have a global API key | |
| 226 | - $args['api_key'] = get_option( 'rgmk_google_map_api_key', false ) ? get_option( 'rgmk_google_map_api_key' ) : $args['api_key']; | |
| 227 | - | |
| 228 | -		if($args['type']=='image'){ | |
| 229 | - $output .= "<img src='https://maps.googleapis.com/maps/api/staticmap?center=".esc_attr($args['location'])."&maptype=".esc_attr($args['maptype'])."&zoom=".esc_attr($args['zoom'])."&size=".esc_attr($args['static_width'])."x".esc_attr($args['static_height'])."&key=".esc_attr($args['api_key'])."' />"; | |
| 230 | -		}else{ | |
| 231 | - $output .= "<iframe width='".esc_attr($args['width'])."' height='".esc_attr($args['height'])."' frameborder='0' allowfullscreen style='border:0;' src='https://www.google.com/maps/embed/v1/".esc_attr($args['type'])."?q=".esc_attr($args['location'])."&maptype=".esc_attr($args['maptype'])."&zoom=".esc_attr($args['zoom'])."&key=".esc_attr($args['api_key'])."' ></iframe> "; | |
| 232 | - } | |
| 233 | - | |
| 234 | - return $output; | |
| 235 | - | |
| 236 | - } | |
| 161 | + ), | |
| 162 | + 'desc_tip' => true, | |
| 163 | + 'default' => 'roadmap', | |
| 164 | + 'advanced' => true | |
| 165 | + ), | |
| 166 | + 'zoom' => array( | |
| 167 | + 'type' => 'select', | |
| 168 | + 'title' => __( 'Zoom level:', 'geodirectory' ), | |
| 169 | + 'desc' => __( 'This is the zoom level of the map, `auto` is recommended.', 'geodirectory' ), | |
| 170 | + 'options' => range( 1, 19 ), | |
| 171 | + 'placeholder' => '', | |
| 172 | + 'desc_tip' => true, | |
| 173 | + 'default' => '7', | |
| 174 | + 'advanced' => true | |
| 175 | + ), | |
| 176 | + 'api_key' => array( | |
| 177 | + 'type' => 'text', | |
| 178 | + 'title' => __( 'Api Key:', 'geodirectory' ), | |
| 179 | + 'desc' => __( 'This is the height of the map, you can use %, px or vh here.', 'geodirectory' ), | |
| 180 | + 'placeholder' => '', | |
| 181 | + 'desc_tip' => true, | |
| 182 | + 'default' => '', | |
| 183 | + 'element_require' => get_option( 'rgmk_google_map_api_key', false) ? '1==0' : '1==1', | |
| 184 | + 'advanced' => false | |
| 185 | + ), | |
| 186 | + ) | |
| 187 | + ); | |
| 188 | + | |
| 189 | + parent::__construct( $options ); | |
| 190 | + } | |
| 191 | + | |
| 192 | + | |
| 193 | + /** | |
| 194 | + * This is the output function for the widget, shortcode and block (front end). | |
| 195 | + * | |
| 196 | + * @param array $args The arguments values. | |
| 197 | + * @param array $widget_args The widget arguments when used. | |
| 198 | + * @param string $content The shortcode content argument | |
| 199 | + * | |
| 200 | + * @return string | |
| 201 | + */ | |
| 202 | +    public function output( $args = array(), $widget_args = array(), $content = '' ) { | |
| 203 | + | |
| 204 | + // options | |
| 205 | + $defaults = array( | |
| 206 | + 'type' => 'image', // image, place | |
| 207 | + 'location' => 'Ireland', | |
| 208 | + 'static_width' => '600', | |
| 209 | + 'static_height' => '400', | |
| 210 | + 'width'=> '100%', | |
| 211 | + 'height'=> '425px', | |
| 212 | + 'maptype' => 'roadmap', | |
| 213 | + 'zoom' => '7', | |
| 214 | + 'api_key' => 'AIzaSyBK3ZcmK0ljxl5agNyJNQh_G24Thq1btuE', | |
| 215 | + ); | |
| 216 | + | |
| 217 | + /** | |
| 218 | + * Parse incoming $args into an array and merge it with $defaults | |
| 219 | + */ | |
| 220 | + $args = wp_parse_args($args, $defaults ); | |
| 221 | + | |
| 222 | + $output = ''; | |
| 223 | + | |
| 224 | + | |
| 225 | + // check if we have a global API key | |
| 226 | + $args['api_key'] = get_option( 'rgmk_google_map_api_key', false ) ? get_option( 'rgmk_google_map_api_key' ) : $args['api_key']; | |
| 227 | + | |
| 228 | +        if($args['type']=='image'){ | |
| 229 | + $output .= "<img src='https://maps.googleapis.com/maps/api/staticmap?center=".esc_attr($args['location'])."&maptype=".esc_attr($args['maptype'])."&zoom=".esc_attr($args['zoom'])."&size=".esc_attr($args['static_width'])."x".esc_attr($args['static_height'])."&key=".esc_attr($args['api_key'])."' />"; | |
| 230 | +        }else{ | |
| 231 | + $output .= "<iframe width='".esc_attr($args['width'])."' height='".esc_attr($args['height'])."' frameborder='0' allowfullscreen style='border:0;' src='https://www.google.com/maps/embed/v1/".esc_attr($args['type'])."?q=".esc_attr($args['location'])."&maptype=".esc_attr($args['maptype'])."&zoom=".esc_attr($args['zoom'])."&key=".esc_attr($args['api_key'])."' ></iframe> "; | |
| 232 | + } | |
| 233 | + | |
| 234 | + return $output; | |
| 235 | + | |
| 236 | + } | |
| 237 | 237 | |
| 238 | 238 | } | 
| 239 | 239 | |
| 240 | 240 | // register it. | 
| 241 | 241 |  add_action( 'widgets_init', function () { | 
| 242 | - register_widget( 'SD_Map' ); | |
| 242 | + register_widget( 'SD_Map' ); | |
| 243 | 243 | } ); | 
| @@ -3,8 +3,8 @@ | ||
| 3 | 3 | |
| 4 | 4 | class ClanCatsFrameworkInstaller extends BaseInstaller | 
| 5 | 5 |  { | 
| 6 | - protected $locations = array( | |
| 7 | -		'ship'      => 'CCF/orbit/{$name}/', | |
| 8 | -		'theme'     => 'CCF/app/themes/{$name}/', | |
| 9 | - ); | |
| 6 | + protected $locations = array( | |
| 7 | +        'ship'      => 'CCF/orbit/{$name}/', | |
| 8 | +        'theme'     => 'CCF/app/themes/{$name}/', | |
| 9 | + ); | |
| 10 | 10 | } | 
| 11 | 11 | \ No newline at end of file | 
| @@ -4,7 +4,7 @@ discard block | ||
| 4 | 4 | */ | 
| 5 | 5 | |
| 6 | 6 |  if ( ! defined( 'ABSPATH' ) ) { | 
| 7 | - exit; | |
| 7 | + exit; | |
| 8 | 8 | } | 
| 9 | 9 | |
| 10 | 10 | /** | 
| @@ -12,112 +12,112 @@ discard block | ||
| 12 | 12 | */ | 
| 13 | 13 |  abstract class WPInv_Session { | 
| 14 | 14 | |
| 15 | - /** | |
| 16 | - * Customer ID. | |
| 17 | - * | |
| 18 | - * @var int $_customer_id Customer ID. | |
| 19 | - */ | |
| 20 | - protected $_customer_id; | |
| 15 | + /** | |
| 16 | + * Customer ID. | |
| 17 | + * | |
| 18 | + * @var int $_customer_id Customer ID. | |
| 19 | + */ | |
| 20 | + protected $_customer_id; | |
| 21 | 21 | |
| 22 | - /** | |
| 23 | - * Session Data. | |
| 24 | - * | |
| 25 | - * @var array $_data Data array. | |
| 26 | - */ | |
| 27 | - protected $_data = array(); | |
| 22 | + /** | |
| 23 | + * Session Data. | |
| 24 | + * | |
| 25 | + * @var array $_data Data array. | |
| 26 | + */ | |
| 27 | + protected $_data = array(); | |
| 28 | 28 | |
| 29 | - /** | |
| 30 | - * Dirty when the session needs saving. | |
| 31 | - * | |
| 32 | - * @var bool $_dirty When something changes | |
| 33 | - */ | |
| 34 | - protected $_dirty = false; | |
| 29 | + /** | |
| 30 | + * Dirty when the session needs saving. | |
| 31 | + * | |
| 32 | + * @var bool $_dirty When something changes | |
| 33 | + */ | |
| 34 | + protected $_dirty = false; | |
| 35 | 35 | |
| 36 | - /** | |
| 37 | - * Init hooks and session data. Extended by child classes. | |
| 38 | - * | |
| 39 | - * @since 3.3.0 | |
| 40 | - */ | |
| 41 | -	public function init() {} | |
| 36 | + /** | |
| 37 | + * Init hooks and session data. Extended by child classes. | |
| 38 | + * | |
| 39 | + * @since 3.3.0 | |
| 40 | + */ | |
| 41 | +    public function init() {} | |
| 42 | 42 | |
| 43 | - /** | |
| 44 | - * Cleanup session data. Extended by child classes. | |
| 45 | - */ | |
| 46 | -	public function cleanup_sessions() {} | |
| 43 | + /** | |
| 44 | + * Cleanup session data. Extended by child classes. | |
| 45 | + */ | |
| 46 | +    public function cleanup_sessions() {} | |
| 47 | 47 | |
| 48 | - /** | |
| 49 | - * Magic get method. | |
| 50 | - * | |
| 51 | - * @param mixed $key Key to get. | |
| 52 | - * @return mixed | |
| 53 | - */ | |
| 54 | -	public function __get( $key ) { | |
| 55 | - return $this->get( $key ); | |
| 56 | - } | |
| 48 | + /** | |
| 49 | + * Magic get method. | |
| 50 | + * | |
| 51 | + * @param mixed $key Key to get. | |
| 52 | + * @return mixed | |
| 53 | + */ | |
| 54 | +    public function __get( $key ) { | |
| 55 | + return $this->get( $key ); | |
| 56 | + } | |
| 57 | 57 | |
| 58 | - /** | |
| 59 | - * Magic set method. | |
| 60 | - * | |
| 61 | - * @param mixed $key Key to set. | |
| 62 | - * @param mixed $value Value to set. | |
| 63 | - */ | |
| 64 | -	public function __set( $key, $value ) { | |
| 65 | - $this->set( $key, $value ); | |
| 66 | - } | |
| 58 | + /** | |
| 59 | + * Magic set method. | |
| 60 | + * | |
| 61 | + * @param mixed $key Key to set. | |
| 62 | + * @param mixed $value Value to set. | |
| 63 | + */ | |
| 64 | +    public function __set( $key, $value ) { | |
| 65 | + $this->set( $key, $value ); | |
| 66 | + } | |
| 67 | 67 | |
| 68 | - /** | |
| 69 | - * Magic isset method. | |
| 70 | - * | |
| 71 | - * @param mixed $key Key to check. | |
| 72 | - * @return bool | |
| 73 | - */ | |
| 74 | -	public function __isset( $key ) { | |
| 75 | - return isset( $this->_data[ sanitize_title( $key ) ] ); | |
| 76 | - } | |
| 68 | + /** | |
| 69 | + * Magic isset method. | |
| 70 | + * | |
| 71 | + * @param mixed $key Key to check. | |
| 72 | + * @return bool | |
| 73 | + */ | |
| 74 | +    public function __isset( $key ) { | |
| 75 | + return isset( $this->_data[ sanitize_title( $key ) ] ); | |
| 76 | + } | |
| 77 | 77 | |
| 78 | - /** | |
| 79 | - * Magic unset method. | |
| 80 | - * | |
| 81 | - * @param mixed $key Key to unset. | |
| 82 | - */ | |
| 83 | -	public function __unset( $key ) { | |
| 84 | -		if ( isset( $this->_data[ $key ] ) ) { | |
| 85 | - unset( $this->_data[ $key ] ); | |
| 86 | - $this->_dirty = true; | |
| 87 | - } | |
| 88 | - } | |
| 78 | + /** | |
| 79 | + * Magic unset method. | |
| 80 | + * | |
| 81 | + * @param mixed $key Key to unset. | |
| 82 | + */ | |
| 83 | +    public function __unset( $key ) { | |
| 84 | +        if ( isset( $this->_data[ $key ] ) ) { | |
| 85 | + unset( $this->_data[ $key ] ); | |
| 86 | + $this->_dirty = true; | |
| 87 | + } | |
| 88 | + } | |
| 89 | 89 | |
| 90 | - /** | |
| 91 | - * Get a session variable. | |
| 92 | - * | |
| 93 | - * @param string $key Key to get. | |
| 94 | - * @param mixed $default used if the session variable isn't set. | |
| 95 | - * @return array|string value of session variable | |
| 96 | - */ | |
| 97 | -	public function get( $key, $default = null ) { | |
| 98 | - $key = sanitize_key( $key ); | |
| 99 | - return isset( $this->_data[ $key ] ) ? maybe_unserialize( $this->_data[ $key ] ) : $default; | |
| 100 | - } | |
| 90 | + /** | |
| 91 | + * Get a session variable. | |
| 92 | + * | |
| 93 | + * @param string $key Key to get. | |
| 94 | + * @param mixed $default used if the session variable isn't set. | |
| 95 | + * @return array|string value of session variable | |
| 96 | + */ | |
| 97 | +    public function get( $key, $default = null ) { | |
| 98 | + $key = sanitize_key( $key ); | |
| 99 | + return isset( $this->_data[ $key ] ) ? maybe_unserialize( $this->_data[ $key ] ) : $default; | |
| 100 | + } | |
| 101 | 101 | |
| 102 | - /** | |
| 103 | - * Set a session variable. | |
| 104 | - * | |
| 105 | - * @param string $key Key to set. | |
| 106 | - * @param mixed $value Value to set. | |
| 107 | - */ | |
| 108 | -	public function set( $key, $value ) { | |
| 109 | -		if ( $value !== $this->get( $key ) ) { | |
| 110 | - $this->_data[ sanitize_key( $key ) ] = maybe_serialize( $value ); | |
| 111 | - $this->_dirty = true; | |
| 112 | - } | |
| 113 | - } | |
| 102 | + /** | |
| 103 | + * Set a session variable. | |
| 104 | + * | |
| 105 | + * @param string $key Key to set. | |
| 106 | + * @param mixed $value Value to set. | |
| 107 | + */ | |
| 108 | +    public function set( $key, $value ) { | |
| 109 | +        if ( $value !== $this->get( $key ) ) { | |
| 110 | + $this->_data[ sanitize_key( $key ) ] = maybe_serialize( $value ); | |
| 111 | + $this->_dirty = true; | |
| 112 | + } | |
| 113 | + } | |
| 114 | 114 | |
| 115 | - /** | |
| 116 | - * Get customer ID. | |
| 117 | - * | |
| 118 | - * @return int | |
| 119 | - */ | |
| 120 | -	public function get_customer_id() { | |
| 121 | - return $this->_customer_id; | |
| 122 | - } | |
| 115 | + /** | |
| 116 | + * Get customer ID. | |
| 117 | + * | |
| 118 | + * @return int | |
| 119 | + */ | |
| 120 | +    public function get_customer_id() { | |
| 121 | + return $this->_customer_id; | |
| 122 | + } | |
| 123 | 123 | } | 
| @@ -44,22 +44,22 @@ | ||
| 44 | 44 | parent::__construct( $options ); | 
| 45 | 45 | } | 
| 46 | 46 | |
| 47 | - /** | |
| 48 | - * The Super block output function. | |
| 49 | - * | |
| 50 | - * @param array $args | |
| 51 | - * @param array $widget_args | |
| 52 | - * @param string $content | |
| 53 | - * | |
| 54 | - * @return mixed|string|bool | |
| 55 | - */ | |
| 47 | + /** | |
| 48 | + * The Super block output function. | |
| 49 | + * | |
| 50 | + * @param array $args | |
| 51 | + * @param array $widget_args | |
| 52 | + * @param string $content | |
| 53 | + * | |
| 54 | + * @return mixed|string|bool | |
| 55 | + */ | |
| 56 | 56 |      public function output( $args = array(), $widget_args = array(), $content = '' ) { | 
| 57 | 57 | |
| 58 | - ob_start(); | |
| 58 | + ob_start(); | |
| 59 | 59 | |
| 60 | - wpinv_print_errors(); | |
| 60 | + wpinv_print_errors(); | |
| 61 | 61 | |
| 62 | - return '<div class="wpinv">' . ob_get_clean() . '</div>'; | |
| 62 | + return '<div class="wpinv">' . ob_get_clean() . '</div>'; | |
| 63 | 63 | |
| 64 | 64 | } | 
| 65 | 65 | |
| @@ -11,289 +11,289 @@ | ||
| 11 | 11 | defined( 'ABSPATH' ) || exit; | 
| 12 | 12 | |
| 13 | 13 | return array( | 
| 14 | - 'AF' => array( | |
| 15 | - 'name' => __( 'Africa', 'invoicing' ), | |
| 16 | - 'countries' => array( | |
| 17 | - 'AO', | |
| 18 | - 'BF', | |
| 19 | - 'BI', | |
| 20 | - 'BJ', | |
| 21 | - 'BW', | |
| 22 | - 'CD', | |
| 23 | - 'CF', | |
| 24 | - 'CG', | |
| 25 | - 'CI', | |
| 26 | - 'CM', | |
| 27 | - 'CV', | |
| 28 | - 'DJ', | |
| 29 | - 'DZ', | |
| 30 | - 'EG', | |
| 31 | - 'EH', | |
| 32 | - 'ER', | |
| 33 | - 'ET', | |
| 34 | - 'GA', | |
| 35 | - 'GH', | |
| 36 | - 'GM', | |
| 37 | - 'GN', | |
| 38 | - 'GQ', | |
| 39 | - 'GW', | |
| 40 | - 'KE', | |
| 41 | - 'KM', | |
| 42 | - 'LR', | |
| 43 | - 'LS', | |
| 44 | - 'LY', | |
| 45 | - 'MA', | |
| 46 | - 'MG', | |
| 47 | - 'ML', | |
| 48 | - 'MR', | |
| 49 | - 'MU', | |
| 50 | - 'MW', | |
| 51 | - 'MZ', | |
| 52 | - 'NA', | |
| 53 | - 'NE', | |
| 54 | - 'NG', | |
| 55 | - 'RE', | |
| 56 | - 'RW', | |
| 57 | - 'SC', | |
| 58 | - 'SD', | |
| 59 | - 'SH', | |
| 60 | - 'SL', | |
| 61 | - 'SN', | |
| 62 | - 'SO', | |
| 63 | - 'SS', | |
| 64 | - 'ST', | |
| 65 | - 'SZ', | |
| 66 | - 'TD', | |
| 67 | - 'TG', | |
| 68 | - 'TN', | |
| 69 | - 'TZ', | |
| 70 | - 'UG', | |
| 71 | - 'YT', | |
| 72 | - 'ZA', | |
| 73 | - 'ZM', | |
| 74 | - 'ZW', | |
| 75 | - ), | |
| 76 | - ), | |
| 77 | - 'AN' => array( | |
| 78 | - 'name' => __( 'Antarctica', 'invoicing' ), | |
| 79 | - 'countries' => array( | |
| 80 | - 'AQ', | |
| 81 | - 'BV', | |
| 82 | - 'GS', | |
| 83 | - 'HM', | |
| 84 | - 'TF', | |
| 85 | - ), | |
| 86 | - ), | |
| 87 | - 'AS' => array( | |
| 88 | - 'name' => __( 'Asia', 'invoicing' ), | |
| 89 | - 'countries' => array( | |
| 90 | - 'AE', | |
| 91 | - 'AF', | |
| 92 | - 'AM', | |
| 93 | - 'AZ', | |
| 94 | - 'BD', | |
| 95 | - 'BH', | |
| 96 | - 'BN', | |
| 97 | - 'BT', | |
| 98 | - 'CC', | |
| 99 | - 'CN', | |
| 100 | - 'CX', | |
| 101 | - 'CY', | |
| 102 | - 'GE', | |
| 103 | - 'HK', | |
| 104 | - 'ID', | |
| 105 | - 'IL', | |
| 106 | - 'IN', | |
| 107 | - 'IO', | |
| 108 | - 'IQ', | |
| 109 | - 'IR', | |
| 110 | - 'JO', | |
| 111 | - 'JP', | |
| 112 | - 'KG', | |
| 113 | - 'KH', | |
| 114 | - 'KP', | |
| 115 | - 'KR', | |
| 116 | - 'KW', | |
| 117 | - 'KZ', | |
| 118 | - 'LA', | |
| 119 | - 'LB', | |
| 120 | - 'LK', | |
| 121 | - 'MM', | |
| 122 | - 'MN', | |
| 123 | - 'MO', | |
| 124 | - 'MV', | |
| 125 | - 'MY', | |
| 126 | - 'NP', | |
| 127 | - 'OM', | |
| 128 | - 'PH', | |
| 129 | - 'PK', | |
| 130 | - 'PS', | |
| 131 | - 'QA', | |
| 132 | - 'SA', | |
| 133 | - 'SG', | |
| 134 | - 'SY', | |
| 135 | - 'TH', | |
| 136 | - 'TJ', | |
| 137 | - 'TL', | |
| 138 | - 'TM', | |
| 139 | - 'TW', | |
| 140 | - 'UZ', | |
| 141 | - 'VN', | |
| 142 | - 'YE', | |
| 143 | - ), | |
| 144 | - ), | |
| 145 | - 'EU' => array( | |
| 146 | - 'name' => __( 'Europe', 'invoicing' ), | |
| 147 | - 'countries' => array( | |
| 148 | - 'AD', | |
| 149 | - 'AL', | |
| 150 | - 'AT', | |
| 151 | - 'AX', | |
| 152 | - 'BA', | |
| 153 | - 'BE', | |
| 154 | - 'BG', | |
| 155 | - 'BY', | |
| 156 | - 'CH', | |
| 157 | - 'CY', | |
| 158 | - 'CZ', | |
| 159 | - 'DE', | |
| 160 | - 'DK', | |
| 161 | - 'EE', | |
| 162 | - 'ES', | |
| 163 | - 'FI', | |
| 164 | - 'FO', | |
| 165 | - 'FR', | |
| 166 | - 'GB', | |
| 167 | - 'GG', | |
| 168 | - 'GI', | |
| 169 | - 'GR', | |
| 170 | - 'HR', | |
| 171 | - 'HU', | |
| 172 | - 'IE', | |
| 173 | - 'IM', | |
| 174 | - 'IS', | |
| 175 | - 'IT', | |
| 176 | - 'JE', | |
| 177 | - 'LI', | |
| 178 | - 'LT', | |
| 179 | - 'LU', | |
| 180 | - 'LV', | |
| 181 | - 'MC', | |
| 182 | - 'MD', | |
| 183 | - 'ME', | |
| 184 | - 'MK', | |
| 185 | - 'MT', | |
| 186 | - 'NL', | |
| 187 | - 'NO', | |
| 188 | - 'PL', | |
| 189 | - 'PT', | |
| 190 | - 'RO', | |
| 191 | - 'RS', | |
| 192 | - 'RU', | |
| 193 | - 'SE', | |
| 194 | - 'SI', | |
| 195 | - 'SJ', | |
| 196 | - 'SK', | |
| 197 | - 'SM', | |
| 198 | - 'TR', | |
| 199 | - 'UA', | |
| 200 | - 'VA', | |
| 201 | - ), | |
| 202 | - ), | |
| 203 | - 'NA' => array( | |
| 204 | - 'name' => __( 'North America', 'invoicing' ), | |
| 205 | - 'countries' => array( | |
| 206 | - 'AG', | |
| 207 | - 'AI', | |
| 208 | - 'AW', | |
| 209 | - 'BB', | |
| 210 | - 'BL', | |
| 211 | - 'BM', | |
| 212 | - 'BQ', | |
| 213 | - 'BS', | |
| 214 | - 'BZ', | |
| 215 | - 'CA', | |
| 216 | - 'CR', | |
| 217 | - 'CU', | |
| 218 | - 'CW', | |
| 219 | - 'DM', | |
| 220 | - 'DO', | |
| 221 | - 'GD', | |
| 222 | - 'GL', | |
| 223 | - 'GP', | |
| 224 | - 'GT', | |
| 225 | - 'HN', | |
| 226 | - 'HT', | |
| 227 | - 'JM', | |
| 228 | - 'KN', | |
| 229 | - 'KY', | |
| 230 | - 'LC', | |
| 231 | - 'MF', | |
| 232 | - 'MQ', | |
| 233 | - 'MS', | |
| 234 | - 'MX', | |
| 235 | - 'NI', | |
| 236 | - 'PA', | |
| 237 | - 'PM', | |
| 238 | - 'PR', | |
| 239 | - 'SV', | |
| 240 | - 'SX', | |
| 241 | - 'TC', | |
| 242 | - 'TT', | |
| 243 | - 'US', | |
| 244 | - 'VC', | |
| 245 | - 'VG', | |
| 246 | - 'VI', | |
| 247 | - ), | |
| 248 | - ), | |
| 249 | - 'OC' => array( | |
| 250 | - 'name' => __( 'Oceania', 'invoicing' ), | |
| 251 | - 'countries' => array( | |
| 252 | - 'AS', | |
| 253 | - 'AU', | |
| 254 | - 'CK', | |
| 255 | - 'FJ', | |
| 256 | - 'FM', | |
| 257 | - 'GU', | |
| 258 | - 'KI', | |
| 259 | - 'MH', | |
| 260 | - 'MP', | |
| 261 | - 'NC', | |
| 262 | - 'NF', | |
| 263 | - 'NR', | |
| 264 | - 'NU', | |
| 265 | - 'NZ', | |
| 266 | - 'PF', | |
| 267 | - 'PG', | |
| 268 | - 'PN', | |
| 269 | - 'PW', | |
| 270 | - 'SB', | |
| 271 | - 'TK', | |
| 272 | - 'TO', | |
| 273 | - 'TV', | |
| 274 | - 'UM', | |
| 275 | - 'VU', | |
| 276 | - 'WF', | |
| 277 | - 'WS', | |
| 278 | - ), | |
| 279 | - ), | |
| 280 | - 'SA' => array( | |
| 281 | - 'name' => __( 'South America', 'invoicing' ), | |
| 282 | - 'countries' => array( | |
| 283 | - 'AR', | |
| 284 | - 'BO', | |
| 285 | - 'BR', | |
| 286 | - 'CL', | |
| 287 | - 'CO', | |
| 288 | - 'EC', | |
| 289 | - 'FK', | |
| 290 | - 'GF', | |
| 291 | - 'GY', | |
| 292 | - 'PE', | |
| 293 | - 'PY', | |
| 294 | - 'SR', | |
| 295 | - 'UY', | |
| 296 | - 'VE', | |
| 297 | - ), | |
| 298 | - ), | |
| 14 | + 'AF' => array( | |
| 15 | + 'name' => __( 'Africa', 'invoicing' ), | |
| 16 | + 'countries' => array( | |
| 17 | + 'AO', | |
| 18 | + 'BF', | |
| 19 | + 'BI', | |
| 20 | + 'BJ', | |
| 21 | + 'BW', | |
| 22 | + 'CD', | |
| 23 | + 'CF', | |
| 24 | + 'CG', | |
| 25 | + 'CI', | |
| 26 | + 'CM', | |
| 27 | + 'CV', | |
| 28 | + 'DJ', | |
| 29 | + 'DZ', | |
| 30 | + 'EG', | |
| 31 | + 'EH', | |
| 32 | + 'ER', | |
| 33 | + 'ET', | |
| 34 | + 'GA', | |
| 35 | + 'GH', | |
| 36 | + 'GM', | |
| 37 | + 'GN', | |
| 38 | + 'GQ', | |
| 39 | + 'GW', | |
| 40 | + 'KE', | |
| 41 | + 'KM', | |
| 42 | + 'LR', | |
| 43 | + 'LS', | |
| 44 | + 'LY', | |
| 45 | + 'MA', | |
| 46 | + 'MG', | |
| 47 | + 'ML', | |
| 48 | + 'MR', | |
| 49 | + 'MU', | |
| 50 | + 'MW', | |
| 51 | + 'MZ', | |
| 52 | + 'NA', | |
| 53 | + 'NE', | |
| 54 | + 'NG', | |
| 55 | + 'RE', | |
| 56 | + 'RW', | |
| 57 | + 'SC', | |
| 58 | + 'SD', | |
| 59 | + 'SH', | |
| 60 | + 'SL', | |
| 61 | + 'SN', | |
| 62 | + 'SO', | |
| 63 | + 'SS', | |
| 64 | + 'ST', | |
| 65 | + 'SZ', | |
| 66 | + 'TD', | |
| 67 | + 'TG', | |
| 68 | + 'TN', | |
| 69 | + 'TZ', | |
| 70 | + 'UG', | |
| 71 | + 'YT', | |
| 72 | + 'ZA', | |
| 73 | + 'ZM', | |
| 74 | + 'ZW', | |
| 75 | + ), | |
| 76 | + ), | |
| 77 | + 'AN' => array( | |
| 78 | + 'name' => __( 'Antarctica', 'invoicing' ), | |
| 79 | + 'countries' => array( | |
| 80 | + 'AQ', | |
| 81 | + 'BV', | |
| 82 | + 'GS', | |
| 83 | + 'HM', | |
| 84 | + 'TF', | |
| 85 | + ), | |
| 86 | + ), | |
| 87 | + 'AS' => array( | |
| 88 | + 'name' => __( 'Asia', 'invoicing' ), | |
| 89 | + 'countries' => array( | |
| 90 | + 'AE', | |
| 91 | + 'AF', | |
| 92 | + 'AM', | |
| 93 | + 'AZ', | |
| 94 | + 'BD', | |
| 95 | + 'BH', | |
| 96 | + 'BN', | |
| 97 | + 'BT', | |
| 98 | + 'CC', | |
| 99 | + 'CN', | |
| 100 | + 'CX', | |
| 101 | + 'CY', | |
| 102 | + 'GE', | |
| 103 | + 'HK', | |
| 104 | + 'ID', | |
| 105 | + 'IL', | |
| 106 | + 'IN', | |
| 107 | + 'IO', | |
| 108 | + 'IQ', | |
| 109 | + 'IR', | |
| 110 | + 'JO', | |
| 111 | + 'JP', | |
| 112 | + 'KG', | |
| 113 | + 'KH', | |
| 114 | + 'KP', | |
| 115 | + 'KR', | |
| 116 | + 'KW', | |
| 117 | + 'KZ', | |
| 118 | + 'LA', | |
| 119 | + 'LB', | |
| 120 | + 'LK', | |
| 121 | + 'MM', | |
| 122 | + 'MN', | |
| 123 | + 'MO', | |
| 124 | + 'MV', | |
| 125 | + 'MY', | |
| 126 | + 'NP', | |
| 127 | + 'OM', | |
| 128 | + 'PH', | |
| 129 | + 'PK', | |
| 130 | + 'PS', | |
| 131 | + 'QA', | |
| 132 | + 'SA', | |
| 133 | + 'SG', | |
| 134 | + 'SY', | |
| 135 | + 'TH', | |
| 136 | + 'TJ', | |
| 137 | + 'TL', | |
| 138 | + 'TM', | |
| 139 | + 'TW', | |
| 140 | + 'UZ', | |
| 141 | + 'VN', | |
| 142 | + 'YE', | |
| 143 | + ), | |
| 144 | + ), | |
| 145 | + 'EU' => array( | |
| 146 | + 'name' => __( 'Europe', 'invoicing' ), | |
| 147 | + 'countries' => array( | |
| 148 | + 'AD', | |
| 149 | + 'AL', | |
| 150 | + 'AT', | |
| 151 | + 'AX', | |
| 152 | + 'BA', | |
| 153 | + 'BE', | |
| 154 | + 'BG', | |
| 155 | + 'BY', | |
| 156 | + 'CH', | |
| 157 | + 'CY', | |
| 158 | + 'CZ', | |
| 159 | + 'DE', | |
| 160 | + 'DK', | |
| 161 | + 'EE', | |
| 162 | + 'ES', | |
| 163 | + 'FI', | |
| 164 | + 'FO', | |
| 165 | + 'FR', | |
| 166 | + 'GB', | |
| 167 | + 'GG', | |
| 168 | + 'GI', | |
| 169 | + 'GR', | |
| 170 | + 'HR', | |
| 171 | + 'HU', | |
| 172 | + 'IE', | |
| 173 | + 'IM', | |
| 174 | + 'IS', | |
| 175 | + 'IT', | |
| 176 | + 'JE', | |
| 177 | + 'LI', | |
| 178 | + 'LT', | |
| 179 | + 'LU', | |
| 180 | + 'LV', | |
| 181 | + 'MC', | |
| 182 | + 'MD', | |
| 183 | + 'ME', | |
| 184 | + 'MK', | |
| 185 | + 'MT', | |
| 186 | + 'NL', | |
| 187 | + 'NO', | |
| 188 | + 'PL', | |
| 189 | + 'PT', | |
| 190 | + 'RO', | |
| 191 | + 'RS', | |
| 192 | + 'RU', | |
| 193 | + 'SE', | |
| 194 | + 'SI', | |
| 195 | + 'SJ', | |
| 196 | + 'SK', | |
| 197 | + 'SM', | |
| 198 | + 'TR', | |
| 199 | + 'UA', | |
| 200 | + 'VA', | |
| 201 | + ), | |
| 202 | + ), | |
| 203 | + 'NA' => array( | |
| 204 | + 'name' => __( 'North America', 'invoicing' ), | |
| 205 | + 'countries' => array( | |
| 206 | + 'AG', | |
| 207 | + 'AI', | |
| 208 | + 'AW', | |
| 209 | + 'BB', | |
| 210 | + 'BL', | |
| 211 | + 'BM', | |
| 212 | + 'BQ', | |
| 213 | + 'BS', | |
| 214 | + 'BZ', | |
| 215 | + 'CA', | |
| 216 | + 'CR', | |
| 217 | + 'CU', | |
| 218 | + 'CW', | |
| 219 | + 'DM', | |
| 220 | + 'DO', | |
| 221 | + 'GD', | |
| 222 | + 'GL', | |
| 223 | + 'GP', | |
| 224 | + 'GT', | |
| 225 | + 'HN', | |
| 226 | + 'HT', | |
| 227 | + 'JM', | |
| 228 | + 'KN', | |
| 229 | + 'KY', | |
| 230 | + 'LC', | |
| 231 | + 'MF', | |
| 232 | + 'MQ', | |
| 233 | + 'MS', | |
| 234 | + 'MX', | |
| 235 | + 'NI', | |
| 236 | + 'PA', | |
| 237 | + 'PM', | |
| 238 | + 'PR', | |
| 239 | + 'SV', | |
| 240 | + 'SX', | |
| 241 | + 'TC', | |
| 242 | + 'TT', | |
| 243 | + 'US', | |
| 244 | + 'VC', | |
| 245 | + 'VG', | |
| 246 | + 'VI', | |
| 247 | + ), | |
| 248 | + ), | |
| 249 | + 'OC' => array( | |
| 250 | + 'name' => __( 'Oceania', 'invoicing' ), | |
| 251 | + 'countries' => array( | |
| 252 | + 'AS', | |
| 253 | + 'AU', | |
| 254 | + 'CK', | |
| 255 | + 'FJ', | |
| 256 | + 'FM', | |
| 257 | + 'GU', | |
| 258 | + 'KI', | |
| 259 | + 'MH', | |
| 260 | + 'MP', | |
| 261 | + 'NC', | |
| 262 | + 'NF', | |
| 263 | + 'NR', | |
| 264 | + 'NU', | |
| 265 | + 'NZ', | |
| 266 | + 'PF', | |
| 267 | + 'PG', | |
| 268 | + 'PN', | |
| 269 | + 'PW', | |
| 270 | + 'SB', | |
| 271 | + 'TK', | |
| 272 | + 'TO', | |
| 273 | + 'TV', | |
| 274 | + 'UM', | |
| 275 | + 'VU', | |
| 276 | + 'WF', | |
| 277 | + 'WS', | |
| 278 | + ), | |
| 279 | + ), | |
| 280 | + 'SA' => array( | |
| 281 | + 'name' => __( 'South America', 'invoicing' ), | |
| 282 | + 'countries' => array( | |
| 283 | + 'AR', | |
| 284 | + 'BO', | |
| 285 | + 'BR', | |
| 286 | + 'CL', | |
| 287 | + 'CO', | |
| 288 | + 'EC', | |
| 289 | + 'FK', | |
| 290 | + 'GF', | |
| 291 | + 'GY', | |
| 292 | + 'PE', | |
| 293 | + 'PY', | |
| 294 | + 'SR', | |
| 295 | + 'UY', | |
| 296 | + 'VE', | |
| 297 | + ), | |
| 298 | + ), | |
| 299 | 299 | ); | 
| @@ -14,1537 +14,1537 @@ | ||
| 14 | 14 | defined( 'ABSPATH' ) || exit; | 
| 15 | 15 | |
| 16 | 16 | return array( | 
| 17 | - 'AF' => array(), | |
| 18 | - 'AO' => array( // Angola states. | |
| 19 | - 'BGO' => __( 'Bengo', 'invoicing' ), | |
| 20 | - 'BLU' => __( 'Benguela', 'invoicing' ), | |
| 21 | - 'BIE' => __( 'Bié', 'invoicing' ), | |
| 22 | - 'CAB' => __( 'Cabinda', 'invoicing' ), | |
| 23 | - 'CNN' => __( 'Cunene', 'invoicing' ), | |
| 24 | - 'HUA' => __( 'Huambo', 'invoicing' ), | |
| 25 | - 'HUI' => __( 'Huíla', 'invoicing' ), | |
| 26 | - 'CCU' => __( 'Kuando Kubango', 'invoicing' ), | |
| 27 | - 'CNO' => __( 'Kwanza-Norte', 'invoicing' ), | |
| 28 | - 'CUS' => __( 'Kwanza-Sul', 'invoicing' ), | |
| 29 | - 'LUA' => __( 'Luanda', 'invoicing' ), | |
| 30 | - 'LNO' => __( 'Lunda-Norte', 'invoicing' ), | |
| 31 | - 'LSU' => __( 'Lunda-Sul', 'invoicing' ), | |
| 32 | - 'MAL' => __( 'Malanje', 'invoicing' ), | |
| 33 | - 'MOX' => __( 'Moxico', 'invoicing' ), | |
| 34 | - 'NAM' => __( 'Namibe', 'invoicing' ), | |
| 35 | - 'UIG' => __( 'Uíge', 'invoicing' ), | |
| 36 | - 'ZAI' => __( 'Zaire', 'invoicing' ), | |
| 37 | - ), | |
| 38 | - 'AR' => array( // Argentinian provinces. | |
| 39 | - 'C' => __( 'Ciudad Autónoma de Buenos Aires', 'invoicing' ), | |
| 40 | - 'B' => __( 'Buenos Aires', 'invoicing' ), | |
| 41 | - 'K' => __( 'Catamarca', 'invoicing' ), | |
| 42 | - 'H' => __( 'Chaco', 'invoicing' ), | |
| 43 | - 'U' => __( 'Chubut', 'invoicing' ), | |
| 44 | - 'X' => __( 'Córdoba', 'invoicing' ), | |
| 45 | - 'W' => __( 'Corrientes', 'invoicing' ), | |
| 46 | - 'E' => __( 'Entre Ríos', 'invoicing' ), | |
| 47 | - 'P' => __( 'Formosa', 'invoicing' ), | |
| 48 | - 'Y' => __( 'Jujuy', 'invoicing' ), | |
| 49 | - 'L' => __( 'La Pampa', 'invoicing' ), | |
| 50 | - 'F' => __( 'La Rioja', 'invoicing' ), | |
| 51 | - 'M' => __( 'Mendoza', 'invoicing' ), | |
| 52 | - 'N' => __( 'Misiones', 'invoicing' ), | |
| 53 | - 'Q' => __( 'Neuquén', 'invoicing' ), | |
| 54 | - 'R' => __( 'Río Negro', 'invoicing' ), | |
| 55 | - 'A' => __( 'Salta', 'invoicing' ), | |
| 56 | - 'J' => __( 'San Juan', 'invoicing' ), | |
| 57 | - 'D' => __( 'San Luis', 'invoicing' ), | |
| 58 | - 'Z' => __( 'Santa Cruz', 'invoicing' ), | |
| 59 | - 'S' => __( 'Santa Fe', 'invoicing' ), | |
| 60 | - 'G' => __( 'Santiago del Estero', 'invoicing' ), | |
| 61 | - 'V' => __( 'Tierra del Fuego', 'invoicing' ), | |
| 62 | - 'T' => __( 'Tucumán', 'invoicing' ), | |
| 63 | - ), | |
| 64 | - 'AT' => array(), | |
| 65 | - 'AU' => array( // Australian states. | |
| 66 | - 'ACT' => __( 'Australian Capital Territory', 'invoicing' ), | |
| 67 | - 'NSW' => __( 'New South Wales', 'invoicing' ), | |
| 68 | - 'NT' => __( 'Northern Territory', 'invoicing' ), | |
| 69 | - 'QLD' => __( 'Queensland', 'invoicing' ), | |
| 70 | - 'SA' => __( 'South Australia', 'invoicing' ), | |
| 71 | - 'TAS' => __( 'Tasmania', 'invoicing' ), | |
| 72 | - 'VIC' => __( 'Victoria', 'invoicing' ), | |
| 73 | - 'WA' => __( 'Western Australia', 'invoicing' ), | |
| 74 | - ), | |
| 75 | - 'AX' => array(), | |
| 76 | - 'BD' => array( // Bangladeshi states (districts). | |
| 77 | - 'BD-05' => __( 'Bagerhat', 'invoicing' ), | |
| 78 | - 'BD-01' => __( 'Bandarban', 'invoicing' ), | |
| 79 | - 'BD-02' => __( 'Barguna', 'invoicing' ), | |
| 80 | - 'BD-06' => __( 'Barishal', 'invoicing' ), | |
| 81 | - 'BD-07' => __( 'Bhola', 'invoicing' ), | |
| 82 | - 'BD-03' => __( 'Bogura', 'invoicing' ), | |
| 83 | - 'BD-04' => __( 'Brahmanbaria', 'invoicing' ), | |
| 84 | - 'BD-09' => __( 'Chandpur', 'invoicing' ), | |
| 85 | - 'BD-10' => __( 'Chattogram', 'invoicing' ), | |
| 86 | - 'BD-12' => __( 'Chuadanga', 'invoicing' ), | |
| 87 | - 'BD-11' => __( "Cox's Bazar", 'invoicing' ), | |
| 88 | - 'BD-08' => __( 'Cumilla', 'invoicing' ), | |
| 89 | - 'BD-13' => __( 'Dhaka', 'invoicing' ), | |
| 90 | - 'BD-14' => __( 'Dinajpur', 'invoicing' ), | |
| 91 | - 'BD-15' => __( 'Faridpur ', 'invoicing' ), | |
| 92 | - 'BD-16' => __( 'Feni', 'invoicing' ), | |
| 93 | - 'BD-19' => __( 'Gaibandha', 'invoicing' ), | |
| 94 | - 'BD-18' => __( 'Gazipur', 'invoicing' ), | |
| 95 | - 'BD-17' => __( 'Gopalganj', 'invoicing' ), | |
| 96 | - 'BD-20' => __( 'Habiganj', 'invoicing' ), | |
| 97 | - 'BD-21' => __( 'Jamalpur', 'invoicing' ), | |
| 98 | - 'BD-22' => __( 'Jashore', 'invoicing' ), | |
| 99 | - 'BD-25' => __( 'Jhalokati', 'invoicing' ), | |
| 100 | - 'BD-23' => __( 'Jhenaidah', 'invoicing' ), | |
| 101 | - 'BD-24' => __( 'Joypurhat', 'invoicing' ), | |
| 102 | - 'BD-29' => __( 'Khagrachhari', 'invoicing' ), | |
| 103 | - 'BD-27' => __( 'Khulna', 'invoicing' ), | |
| 104 | - 'BD-26' => __( 'Kishoreganj', 'invoicing' ), | |
| 105 | - 'BD-28' => __( 'Kurigram', 'invoicing' ), | |
| 106 | - 'BD-30' => __( 'Kushtia', 'invoicing' ), | |
| 107 | - 'BD-31' => __( 'Lakshmipur', 'invoicing' ), | |
| 108 | - 'BD-32' => __( 'Lalmonirhat', 'invoicing' ), | |
| 109 | - 'BD-36' => __( 'Madaripur', 'invoicing' ), | |
| 110 | - 'BD-37' => __( 'Magura', 'invoicing' ), | |
| 111 | - 'BD-33' => __( 'Manikganj ', 'invoicing' ), | |
| 112 | - 'BD-39' => __( 'Meherpur', 'invoicing' ), | |
| 113 | - 'BD-38' => __( 'Moulvibazar', 'invoicing' ), | |
| 114 | - 'BD-35' => __( 'Munshiganj', 'invoicing' ), | |
| 115 | - 'BD-34' => __( 'Mymensingh', 'invoicing' ), | |
| 116 | - 'BD-48' => __( 'Naogaon', 'invoicing' ), | |
| 117 | - 'BD-43' => __( 'Narail', 'invoicing' ), | |
| 118 | - 'BD-40' => __( 'Narayanganj', 'invoicing' ), | |
| 119 | - 'BD-42' => __( 'Narsingdi', 'invoicing' ), | |
| 120 | - 'BD-44' => __( 'Natore', 'invoicing' ), | |
| 121 | - 'BD-45' => __( 'Nawabganj', 'invoicing' ), | |
| 122 | - 'BD-41' => __( 'Netrakona', 'invoicing' ), | |
| 123 | - 'BD-46' => __( 'Nilphamari', 'invoicing' ), | |
| 124 | - 'BD-47' => __( 'Noakhali', 'invoicing' ), | |
| 125 | - 'BD-49' => __( 'Pabna', 'invoicing' ), | |
| 126 | - 'BD-52' => __( 'Panchagarh', 'invoicing' ), | |
| 127 | - 'BD-51' => __( 'Patuakhali', 'invoicing' ), | |
| 128 | - 'BD-50' => __( 'Pirojpur', 'invoicing' ), | |
| 129 | - 'BD-53' => __( 'Rajbari', 'invoicing' ), | |
| 130 | - 'BD-54' => __( 'Rajshahi', 'invoicing' ), | |
| 131 | - 'BD-56' => __( 'Rangamati', 'invoicing' ), | |
| 132 | - 'BD-55' => __( 'Rangpur', 'invoicing' ), | |
| 133 | - 'BD-58' => __( 'Satkhira', 'invoicing' ), | |
| 134 | - 'BD-62' => __( 'Shariatpur', 'invoicing' ), | |
| 135 | - 'BD-57' => __( 'Sherpur', 'invoicing' ), | |
| 136 | - 'BD-59' => __( 'Sirajganj', 'invoicing' ), | |
| 137 | - 'BD-61' => __( 'Sunamganj', 'invoicing' ), | |
| 138 | - 'BD-60' => __( 'Sylhet', 'invoicing' ), | |
| 139 | - 'BD-63' => __( 'Tangail', 'invoicing' ), | |
| 140 | - 'BD-64' => __( 'Thakurgaon', 'invoicing' ), | |
| 141 | - ), | |
| 142 | - 'BE' => array(), | |
| 143 | - 'BG' => array( // Bulgarian states. | |
| 144 | - 'BG-01' => __( 'Blagoevgrad', 'invoicing' ), | |
| 145 | - 'BG-02' => __( 'Burgas', 'invoicing' ), | |
| 146 | - 'BG-08' => __( 'Dobrich', 'invoicing' ), | |
| 147 | - 'BG-07' => __( 'Gabrovo', 'invoicing' ), | |
| 148 | - 'BG-26' => __( 'Haskovo', 'invoicing' ), | |
| 149 | - 'BG-09' => __( 'Kardzhali', 'invoicing' ), | |
| 150 | - 'BG-10' => __( 'Kyustendil', 'invoicing' ), | |
| 151 | - 'BG-11' => __( 'Lovech', 'invoicing' ), | |
| 152 | - 'BG-12' => __( 'Montana', 'invoicing' ), | |
| 153 | - 'BG-13' => __( 'Pazardzhik', 'invoicing' ), | |
| 154 | - 'BG-14' => __( 'Pernik', 'invoicing' ), | |
| 155 | - 'BG-15' => __( 'Pleven', 'invoicing' ), | |
| 156 | - 'BG-16' => __( 'Plovdiv', 'invoicing' ), | |
| 157 | - 'BG-17' => __( 'Razgrad', 'invoicing' ), | |
| 158 | - 'BG-18' => __( 'Ruse', 'invoicing' ), | |
| 159 | - 'BG-27' => __( 'Shumen', 'invoicing' ), | |
| 160 | - 'BG-19' => __( 'Silistra', 'invoicing' ), | |
| 161 | - 'BG-20' => __( 'Sliven', 'invoicing' ), | |
| 162 | - 'BG-21' => __( 'Smolyan', 'invoicing' ), | |
| 163 | - 'BG-23' => __( 'Sofia', 'invoicing' ), | |
| 164 | - 'BG-22' => __( 'Sofia-Grad', 'invoicing' ), | |
| 165 | - 'BG-24' => __( 'Stara Zagora', 'invoicing' ), | |
| 166 | - 'BG-25' => __( 'Targovishte', 'invoicing' ), | |
| 167 | - 'BG-03' => __( 'Varna', 'invoicing' ), | |
| 168 | - 'BG-04' => __( 'Veliko Tarnovo', 'invoicing' ), | |
| 169 | - 'BG-05' => __( 'Vidin', 'invoicing' ), | |
| 170 | - 'BG-06' => __( 'Vratsa', 'invoicing' ), | |
| 171 | - 'BG-28' => __( 'Yambol', 'invoicing' ), | |
| 172 | - ), | |
| 173 | - 'BH' => array(), | |
| 174 | - 'BI' => array(), | |
| 175 | - 'BO' => array( // Bolivian states. | |
| 176 | - 'B' => __( 'Chuquisaca', 'invoicing' ), | |
| 177 | - 'H' => __( 'Beni', 'invoicing' ), | |
| 178 | - 'C' => __( 'Cochabamba', 'invoicing' ), | |
| 179 | - 'L' => __( 'La Paz', 'invoicing' ), | |
| 180 | - 'O' => __( 'Oruro', 'invoicing' ), | |
| 181 | - 'N' => __( 'Pando', 'invoicing' ), | |
| 182 | - 'P' => __( 'Potosí', 'invoicing' ), | |
| 183 | - 'S' => __( 'Santa Cruz', 'invoicing' ), | |
| 184 | - 'T' => __( 'Tarija', 'invoicing' ), | |
| 185 | - ), | |
| 186 | - 'BR' => array( // Brazillian states. | |
| 187 | - 'AC' => __( 'Acre', 'invoicing' ), | |
| 188 | - 'AL' => __( 'Alagoas', 'invoicing' ), | |
| 189 | - 'AP' => __( 'Amapá', 'invoicing' ), | |
| 190 | - 'AM' => __( 'Amazonas', 'invoicing' ), | |
| 191 | - 'BA' => __( 'Bahia', 'invoicing' ), | |
| 192 | - 'CE' => __( 'Ceará', 'invoicing' ), | |
| 193 | - 'DF' => __( 'Distrito Federal', 'invoicing' ), | |
| 194 | - 'ES' => __( 'Espírito Santo', 'invoicing' ), | |
| 195 | - 'GO' => __( 'Goiás', 'invoicing' ), | |
| 196 | - 'MA' => __( 'Maranhão', 'invoicing' ), | |
| 197 | - 'MT' => __( 'Mato Grosso', 'invoicing' ), | |
| 198 | - 'MS' => __( 'Mato Grosso do Sul', 'invoicing' ), | |
| 199 | - 'MG' => __( 'Minas Gerais', 'invoicing' ), | |
| 200 | - 'PA' => __( 'Pará', 'invoicing' ), | |
| 201 | - 'PB' => __( 'Paraíba', 'invoicing' ), | |
| 202 | - 'PR' => __( 'Paraná', 'invoicing' ), | |
| 203 | - 'PE' => __( 'Pernambuco', 'invoicing' ), | |
| 204 | - 'PI' => __( 'Piauí', 'invoicing' ), | |
| 205 | - 'RJ' => __( 'Rio de Janeiro', 'invoicing' ), | |
| 206 | - 'RN' => __( 'Rio Grande do Norte', 'invoicing' ), | |
| 207 | - 'RS' => __( 'Rio Grande do Sul', 'invoicing' ), | |
| 208 | - 'RO' => __( 'Rondônia', 'invoicing' ), | |
| 209 | - 'RR' => __( 'Roraima', 'invoicing' ), | |
| 210 | - 'SC' => __( 'Santa Catarina', 'invoicing' ), | |
| 211 | - 'SP' => __( 'São Paulo', 'invoicing' ), | |
| 212 | - 'SE' => __( 'Sergipe', 'invoicing' ), | |
| 213 | - 'TO' => __( 'Tocantins', 'invoicing' ), | |
| 214 | - ), | |
| 215 | - 'CA' => array( // Canadian states. | |
| 216 | - 'AB' => __( 'Alberta', 'invoicing' ), | |
| 217 | - 'BC' => __( 'British Columbia', 'invoicing' ), | |
| 218 | - 'MB' => __( 'Manitoba', 'invoicing' ), | |
| 219 | - 'NB' => __( 'New Brunswick', 'invoicing' ), | |
| 220 | - 'NL' => __( 'Newfoundland and Labrador', 'invoicing' ), | |
| 221 | - 'NT' => __( 'Northwest Territories', 'invoicing' ), | |
| 222 | - 'NS' => __( 'Nova Scotia', 'invoicing' ), | |
| 223 | - 'NU' => __( 'Nunavut', 'invoicing' ), | |
| 224 | - 'ON' => __( 'Ontario', 'invoicing' ), | |
| 225 | - 'PE' => __( 'Prince Edward Island', 'invoicing' ), | |
| 226 | - 'QC' => __( 'Quebec', 'invoicing' ), | |
| 227 | - 'SK' => __( 'Saskatchewan', 'invoicing' ), | |
| 228 | - 'YT' => __( 'Yukon Territory', 'invoicing' ), | |
| 229 | - ), | |
| 230 | - 'CH' => array( // Cantons of Switzerland. | |
| 231 | - 'AG' => __( 'Aargau', 'invoicing' ), | |
| 232 | - 'AR' => __( 'Appenzell Ausserrhoden', 'invoicing' ), | |
| 233 | - 'AI' => __( 'Appenzell Innerrhoden', 'invoicing' ), | |
| 234 | - 'BL' => __( 'Basel-Landschaft', 'invoicing' ), | |
| 235 | - 'BS' => __( 'Basel-Stadt', 'invoicing' ), | |
| 236 | - 'BE' => __( 'Bern', 'invoicing' ), | |
| 237 | - 'FR' => __( 'Fribourg', 'invoicing' ), | |
| 238 | - 'GE' => __( 'Geneva', 'invoicing' ), | |
| 239 | - 'GL' => __( 'Glarus', 'invoicing' ), | |
| 240 | - 'GR' => __( 'Graubünden', 'invoicing' ), | |
| 241 | - 'JU' => __( 'Jura', 'invoicing' ), | |
| 242 | - 'LU' => __( 'Luzern', 'invoicing' ), | |
| 243 | - 'NE' => __( 'Neuchâtel', 'invoicing' ), | |
| 244 | - 'NW' => __( 'Nidwalden', 'invoicing' ), | |
| 245 | - 'OW' => __( 'Obwalden', 'invoicing' ), | |
| 246 | - 'SH' => __( 'Schaffhausen', 'invoicing' ), | |
| 247 | - 'SZ' => __( 'Schwyz', 'invoicing' ), | |
| 248 | - 'SO' => __( 'Solothurn', 'invoicing' ), | |
| 249 | - 'SG' => __( 'St. Gallen', 'invoicing' ), | |
| 250 | - 'TG' => __( 'Thurgau', 'invoicing' ), | |
| 251 | - 'TI' => __( 'Ticino', 'invoicing' ), | |
| 252 | - 'UR' => __( 'Uri', 'invoicing' ), | |
| 253 | - 'VS' => __( 'Valais', 'invoicing' ), | |
| 254 | - 'VD' => __( 'Vaud', 'invoicing' ), | |
| 255 | - 'ZG' => __( 'Zug', 'invoicing' ), | |
| 256 | - 'ZH' => __( 'Zürich', 'invoicing' ), | |
| 257 | - ), | |
| 258 | - 'CN' => array( // Chinese states. | |
| 259 | - 'CN1' => __( 'Yunnan / 云南', 'invoicing' ), | |
| 260 | - 'CN2' => __( 'Beijing / 北京', 'invoicing' ), | |
| 261 | - 'CN3' => __( 'Tianjin / 天津', 'invoicing' ), | |
| 262 | - 'CN4' => __( 'Hebei / 河北', 'invoicing' ), | |
| 263 | - 'CN5' => __( 'Shanxi / 山西', 'invoicing' ), | |
| 264 | - 'CN6' => __( 'Inner Mongolia / 內蒙古', 'invoicing' ), | |
| 265 | - 'CN7' => __( 'Liaoning / 辽宁', 'invoicing' ), | |
| 266 | - 'CN8' => __( 'Jilin / 吉林', 'invoicing' ), | |
| 267 | - 'CN9' => __( 'Heilongjiang / 黑龙江', 'invoicing' ), | |
| 268 | - 'CN10' => __( 'Shanghai / 上海', 'invoicing' ), | |
| 269 | - 'CN11' => __( 'Jiangsu / 江苏', 'invoicing' ), | |
| 270 | - 'CN12' => __( 'Zhejiang / 浙江', 'invoicing' ), | |
| 271 | - 'CN13' => __( 'Anhui / 安徽', 'invoicing' ), | |
| 272 | - 'CN14' => __( 'Fujian / 福建', 'invoicing' ), | |
| 273 | - 'CN15' => __( 'Jiangxi / 江西', 'invoicing' ), | |
| 274 | - 'CN16' => __( 'Shandong / 山东', 'invoicing' ), | |
| 275 | - 'CN17' => __( 'Henan / 河南', 'invoicing' ), | |
| 276 | - 'CN18' => __( 'Hubei / 湖北', 'invoicing' ), | |
| 277 | - 'CN19' => __( 'Hunan / 湖南', 'invoicing' ), | |
| 278 | - 'CN20' => __( 'Guangdong / 广东', 'invoicing' ), | |
| 279 | - 'CN21' => __( 'Guangxi Zhuang / 广西壮族', 'invoicing' ), | |
| 280 | - 'CN22' => __( 'Hainan / 海南', 'invoicing' ), | |
| 281 | - 'CN23' => __( 'Chongqing / 重庆', 'invoicing' ), | |
| 282 | - 'CN24' => __( 'Sichuan / 四川', 'invoicing' ), | |
| 283 | - 'CN25' => __( 'Guizhou / 贵州', 'invoicing' ), | |
| 284 | - 'CN26' => __( 'Shaanxi / 陕西', 'invoicing' ), | |
| 285 | - 'CN27' => __( 'Gansu / 甘肃', 'invoicing' ), | |
| 286 | - 'CN28' => __( 'Qinghai / 青海', 'invoicing' ), | |
| 287 | - 'CN29' => __( 'Ningxia Hui / 宁夏', 'invoicing' ), | |
| 288 | - 'CN30' => __( 'Macao / 澳门', 'invoicing' ), | |
| 289 | - 'CN31' => __( 'Tibet / 西藏', 'invoicing' ), | |
| 290 | - 'CN32' => __( 'Xinjiang / 新疆', 'invoicing' ), | |
| 291 | - ), | |
| 292 | - 'CZ' => array(), | |
| 293 | - 'DE' => array(), | |
| 294 | - 'DK' => array(), | |
| 295 | - 'EE' => array(), | |
| 296 | - 'ES' => array( // Spanish states. | |
| 297 | - 'C' => __( 'A Coruña', 'invoicing' ), | |
| 298 | - 'VI' => __( 'Araba/Álava', 'invoicing' ), | |
| 299 | - 'AB' => __( 'Albacete', 'invoicing' ), | |
| 300 | - 'A' => __( 'Alicante', 'invoicing' ), | |
| 301 | - 'AL' => __( 'Almería', 'invoicing' ), | |
| 302 | - 'O' => __( 'Asturias', 'invoicing' ), | |
| 303 | - 'AV' => __( 'Ávila', 'invoicing' ), | |
| 304 | - 'BA' => __( 'Badajoz', 'invoicing' ), | |
| 305 | - 'PM' => __( 'Baleares', 'invoicing' ), | |
| 306 | - 'B' => __( 'Barcelona', 'invoicing' ), | |
| 307 | - 'BU' => __( 'Burgos', 'invoicing' ), | |
| 308 | - 'CC' => __( 'Cáceres', 'invoicing' ), | |
| 309 | - 'CA' => __( 'Cádiz', 'invoicing' ), | |
| 310 | - 'S' => __( 'Cantabria', 'invoicing' ), | |
| 311 | - 'CS' => __( 'Castellón', 'invoicing' ), | |
| 312 | - 'CE' => __( 'Ceuta', 'invoicing' ), | |
| 313 | - 'CR' => __( 'Ciudad Real', 'invoicing' ), | |
| 314 | - 'CO' => __( 'Córdoba', 'invoicing' ), | |
| 315 | - 'CU' => __( 'Cuenca', 'invoicing' ), | |
| 316 | - 'GI' => __( 'Girona', 'invoicing' ), | |
| 317 | - 'GR' => __( 'Granada', 'invoicing' ), | |
| 318 | - 'GU' => __( 'Guadalajara', 'invoicing' ), | |
| 319 | - 'SS' => __( 'Gipuzkoa', 'invoicing' ), | |
| 320 | - 'H' => __( 'Huelva', 'invoicing' ), | |
| 321 | - 'HU' => __( 'Huesca', 'invoicing' ), | |
| 322 | - 'J' => __( 'Jaén', 'invoicing' ), | |
| 323 | - 'LO' => __( 'La Rioja', 'invoicing' ), | |
| 324 | - 'GC' => __( 'Las Palmas', 'invoicing' ), | |
| 325 | - 'LE' => __( 'León', 'invoicing' ), | |
| 326 | - 'L' => __( 'Lleida', 'invoicing' ), | |
| 327 | - 'LU' => __( 'Lugo', 'invoicing' ), | |
| 328 | - 'M' => __( 'Madrid', 'invoicing' ), | |
| 329 | - 'MA' => __( 'Málaga', 'invoicing' ), | |
| 330 | - 'ML' => __( 'Melilla', 'invoicing' ), | |
| 331 | - 'MU' => __( 'Murcia', 'invoicing' ), | |
| 332 | - 'NA' => __( 'Navarra', 'invoicing' ), | |
| 333 | - 'OR' => __( 'Ourense', 'invoicing' ), | |
| 334 | - 'P' => __( 'Palencia', 'invoicing' ), | |
| 335 | - 'PO' => __( 'Pontevedra', 'invoicing' ), | |
| 336 | - 'SA' => __( 'Salamanca', 'invoicing' ), | |
| 337 | - 'TF' => __( 'Santa Cruz de Tenerife', 'invoicing' ), | |
| 338 | - 'SG' => __( 'Segovia', 'invoicing' ), | |
| 339 | - 'SE' => __( 'Sevilla', 'invoicing' ), | |
| 340 | - 'SO' => __( 'Soria', 'invoicing' ), | |
| 341 | - 'T' => __( 'Tarragona', 'invoicing' ), | |
| 342 | - 'TE' => __( 'Teruel', 'invoicing' ), | |
| 343 | - 'TO' => __( 'Toledo', 'invoicing' ), | |
| 344 | - 'V' => __( 'Valencia', 'invoicing' ), | |
| 345 | - 'VA' => __( 'Valladolid', 'invoicing' ), | |
| 346 | - 'BI' => __( 'Bizkaia', 'invoicing' ), | |
| 347 | - 'ZA' => __( 'Zamora', 'invoicing' ), | |
| 348 | - 'Z' => __( 'Zaragoza', 'invoicing' ), | |
| 349 | - ), | |
| 350 | - 'FI' => array(), | |
| 351 | - 'FR' => array(), | |
| 352 | - 'GP' => array(), | |
| 353 | - 'GR' => array( // Greek Regions. | |
| 354 | - 'I' => __( 'Αττική', 'invoicing' ), | |
| 355 | - 'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'invoicing' ), | |
| 356 | - 'B' => __( 'Κεντρική Μακεδονία', 'invoicing' ), | |
| 357 | - 'C' => __( 'Δυτική Μακεδονία', 'invoicing' ), | |
| 358 | - 'D' => __( 'Ήπειρος', 'invoicing' ), | |
| 359 | - 'E' => __( 'Θεσσαλία', 'invoicing' ), | |
| 360 | - 'F' => __( 'Ιόνιοι Νήσοι', 'invoicing' ), | |
| 361 | - 'G' => __( 'Δυτική Ελλάδα', 'invoicing' ), | |
| 362 | - 'H' => __( 'Στερεά Ελλάδα', 'invoicing' ), | |
| 363 | - 'J' => __( 'Πελοπόννησος', 'invoicing' ), | |
| 364 | - 'K' => __( 'Βόρειο Αιγαίο', 'invoicing' ), | |
| 365 | - 'L' => __( 'Νότιο Αιγαίο', 'invoicing' ), | |
| 366 | - 'M' => __( 'Κρήτη', 'invoicing' ), | |
| 367 | - ), | |
| 368 | - 'GF' => array(), | |
| 369 | - 'HK' => array( // Hong Kong states. | |
| 370 | - 'HONG KONG' => __( 'Hong Kong Island', 'invoicing' ), | |
| 371 | - 'KOWLOON' => __( 'Kowloon', 'invoicing' ), | |
| 372 | - 'NEW TERRITORIES' => __( 'New Territories', 'invoicing' ), | |
| 373 | - ), | |
| 374 | - 'HU' => array( // Hungary states. | |
| 375 | - 'BK' => __( 'Bács-Kiskun', 'invoicing' ), | |
| 376 | - 'BE' => __( 'Békés', 'invoicing' ), | |
| 377 | - 'BA' => __( 'Baranya', 'invoicing' ), | |
| 378 | - 'BZ' => __( 'Borsod-Abaúj-Zemplén', 'invoicing' ), | |
| 379 | - 'BU' => __( 'Budapest', 'invoicing' ), | |
| 380 | - 'CS' => __( 'Csongrád', 'invoicing' ), | |
| 381 | - 'FE' => __( 'Fejér', 'invoicing' ), | |
| 382 | - 'GS' => __( 'Győr-Moson-Sopron', 'invoicing' ), | |
| 383 | - 'HB' => __( 'Hajdú-Bihar', 'invoicing' ), | |
| 384 | - 'HE' => __( 'Heves', 'invoicing' ), | |
| 385 | - 'JN' => __( 'Jász-Nagykun-Szolnok', 'invoicing' ), | |
| 386 | - 'KE' => __( 'Komárom-Esztergom', 'invoicing' ), | |
| 387 | - 'NO' => __( 'Nógrád', 'invoicing' ), | |
| 388 | - 'PE' => __( 'Pest', 'invoicing' ), | |
| 389 | - 'SO' => __( 'Somogy', 'invoicing' ), | |
| 390 | - 'SZ' => __( 'Szabolcs-Szatmár-Bereg', 'invoicing' ), | |
| 391 | - 'TO' => __( 'Tolna', 'invoicing' ), | |
| 392 | - 'VA' => __( 'Vas', 'invoicing' ), | |
| 393 | - 'VE' => __( 'Veszprém', 'invoicing' ), | |
| 394 | - 'ZA' => __( 'Zala', 'invoicing' ), | |
| 395 | - ), | |
| 396 | - 'ID' => array( // Indonesia Provinces. | |
| 397 | - 'AC' => __( 'Daerah Istimewa Aceh', 'invoicing' ), | |
| 398 | - 'SU' => __( 'Sumatera Utara', 'invoicing' ), | |
| 399 | - 'SB' => __( 'Sumatera Barat', 'invoicing' ), | |
| 400 | - 'RI' => __( 'Riau', 'invoicing' ), | |
| 401 | - 'KR' => __( 'Kepulauan Riau', 'invoicing' ), | |
| 402 | - 'JA' => __( 'Jambi', 'invoicing' ), | |
| 403 | - 'SS' => __( 'Sumatera Selatan', 'invoicing' ), | |
| 404 | - 'BB' => __( 'Bangka Belitung', 'invoicing' ), | |
| 405 | - 'BE' => __( 'Bengkulu', 'invoicing' ), | |
| 406 | - 'LA' => __( 'Lampung', 'invoicing' ), | |
| 407 | - 'JK' => __( 'DKI Jakarta', 'invoicing' ), | |
| 408 | - 'JB' => __( 'Jawa Barat', 'invoicing' ), | |
| 409 | - 'BT' => __( 'Banten', 'invoicing' ), | |
| 410 | - 'JT' => __( 'Jawa Tengah', 'invoicing' ), | |
| 411 | - 'JI' => __( 'Jawa Timur', 'invoicing' ), | |
| 412 | - 'YO' => __( 'Daerah Istimewa Yogyakarta', 'invoicing' ), | |
| 413 | - 'BA' => __( 'Bali', 'invoicing' ), | |
| 414 | - 'NB' => __( 'Nusa Tenggara Barat', 'invoicing' ), | |
| 415 | - 'NT' => __( 'Nusa Tenggara Timur', 'invoicing' ), | |
| 416 | - 'KB' => __( 'Kalimantan Barat', 'invoicing' ), | |
| 417 | - 'KT' => __( 'Kalimantan Tengah', 'invoicing' ), | |
| 418 | - 'KI' => __( 'Kalimantan Timur', 'invoicing' ), | |
| 419 | - 'KS' => __( 'Kalimantan Selatan', 'invoicing' ), | |
| 420 | - 'KU' => __( 'Kalimantan Utara', 'invoicing' ), | |
| 421 | - 'SA' => __( 'Sulawesi Utara', 'invoicing' ), | |
| 422 | - 'ST' => __( 'Sulawesi Tengah', 'invoicing' ), | |
| 423 | - 'SG' => __( 'Sulawesi Tenggara', 'invoicing' ), | |
| 424 | - 'SR' => __( 'Sulawesi Barat', 'invoicing' ), | |
| 425 | - 'SN' => __( 'Sulawesi Selatan', 'invoicing' ), | |
| 426 | - 'GO' => __( 'Gorontalo', 'invoicing' ), | |
| 427 | - 'MA' => __( 'Maluku', 'invoicing' ), | |
| 428 | - 'MU' => __( 'Maluku Utara', 'invoicing' ), | |
| 429 | - 'PA' => __( 'Papua', 'invoicing' ), | |
| 430 | - 'PB' => __( 'Papua Barat', 'invoicing' ), | |
| 431 | - ), | |
| 432 | - 'IE' => array( // Republic of Ireland. | |
| 433 | - 'CW' => __( 'Carlow', 'invoicing' ), | |
| 434 | - 'CN' => __( 'Cavan', 'invoicing' ), | |
| 435 | - 'CE' => __( 'Clare', 'invoicing' ), | |
| 436 | - 'CO' => __( 'Cork', 'invoicing' ), | |
| 437 | - 'DL' => __( 'Donegal', 'invoicing' ), | |
| 438 | - 'D' => __( 'Dublin', 'invoicing' ), | |
| 439 | - 'G' => __( 'Galway', 'invoicing' ), | |
| 440 | - 'KY' => __( 'Kerry', 'invoicing' ), | |
| 441 | - 'KE' => __( 'Kildare', 'invoicing' ), | |
| 442 | - 'KK' => __( 'Kilkenny', 'invoicing' ), | |
| 443 | - 'LS' => __( 'Laois', 'invoicing' ), | |
| 444 | - 'LM' => __( 'Leitrim', 'invoicing' ), | |
| 445 | - 'LK' => __( 'Limerick', 'invoicing' ), | |
| 446 | - 'LD' => __( 'Longford', 'invoicing' ), | |
| 447 | - 'LH' => __( 'Louth', 'invoicing' ), | |
| 448 | - 'MO' => __( 'Mayo', 'invoicing' ), | |
| 449 | - 'MH' => __( 'Meath', 'invoicing' ), | |
| 450 | - 'MN' => __( 'Monaghan', 'invoicing' ), | |
| 451 | - 'OY' => __( 'Offaly', 'invoicing' ), | |
| 452 | - 'RN' => __( 'Roscommon', 'invoicing' ), | |
| 453 | - 'SO' => __( 'Sligo', 'invoicing' ), | |
| 454 | - 'TA' => __( 'Tipperary', 'invoicing' ), | |
| 455 | - 'WD' => __( 'Waterford', 'invoicing' ), | |
| 456 | - 'WH' => __( 'Westmeath', 'invoicing' ), | |
| 457 | - 'WX' => __( 'Wexford', 'invoicing' ), | |
| 458 | - 'WW' => __( 'Wicklow', 'invoicing' ), | |
| 459 | - ), | |
| 460 | - 'IN' => array( // Indian states. | |
| 461 | - 'AP' => __( 'Andhra Pradesh', 'invoicing' ), | |
| 462 | - 'AR' => __( 'Arunachal Pradesh', 'invoicing' ), | |
| 463 | - 'AS' => __( 'Assam', 'invoicing' ), | |
| 464 | - 'BR' => __( 'Bihar', 'invoicing' ), | |
| 465 | - 'CT' => __( 'Chhattisgarh', 'invoicing' ), | |
| 466 | - 'GA' => __( 'Goa', 'invoicing' ), | |
| 467 | - 'GJ' => __( 'Gujarat', 'invoicing' ), | |
| 468 | - 'HR' => __( 'Haryana', 'invoicing' ), | |
| 469 | - 'HP' => __( 'Himachal Pradesh', 'invoicing' ), | |
| 470 | - 'JK' => __( 'Jammu and Kashmir', 'invoicing' ), | |
| 471 | - 'JH' => __( 'Jharkhand', 'invoicing' ), | |
| 472 | - 'KA' => __( 'Karnataka', 'invoicing' ), | |
| 473 | - 'KL' => __( 'Kerala', 'invoicing' ), | |
| 474 | - 'MP' => __( 'Madhya Pradesh', 'invoicing' ), | |
| 475 | - 'MH' => __( 'Maharashtra', 'invoicing' ), | |
| 476 | - 'MN' => __( 'Manipur', 'invoicing' ), | |
| 477 | - 'ML' => __( 'Meghalaya', 'invoicing' ), | |
| 478 | - 'MZ' => __( 'Mizoram', 'invoicing' ), | |
| 479 | - 'NL' => __( 'Nagaland', 'invoicing' ), | |
| 480 | - 'OR' => __( 'Orissa', 'invoicing' ), | |
| 481 | - 'PB' => __( 'Punjab', 'invoicing' ), | |
| 482 | - 'RJ' => __( 'Rajasthan', 'invoicing' ), | |
| 483 | - 'SK' => __( 'Sikkim', 'invoicing' ), | |
| 484 | - 'TN' => __( 'Tamil Nadu', 'invoicing' ), | |
| 485 | - 'TS' => __( 'Telangana', 'invoicing' ), | |
| 486 | - 'TR' => __( 'Tripura', 'invoicing' ), | |
| 487 | - 'UK' => __( 'Uttarakhand', 'invoicing' ), | |
| 488 | - 'UP' => __( 'Uttar Pradesh', 'invoicing' ), | |
| 489 | - 'WB' => __( 'West Bengal', 'invoicing' ), | |
| 490 | - 'AN' => __( 'Andaman and Nicobar Islands', 'invoicing' ), | |
| 491 | - 'CH' => __( 'Chandigarh', 'invoicing' ), | |
| 492 | - 'DN' => __( 'Dadra and Nagar Haveli', 'invoicing' ), | |
| 493 | - 'DD' => __( 'Daman and Diu', 'invoicing' ), | |
| 494 | - 'DL' => __( 'Delhi', 'invoicing' ), | |
| 495 | - 'LD' => __( 'Lakshadeep', 'invoicing' ), | |
| 496 | - 'PY' => __( 'Pondicherry (Puducherry)', 'invoicing' ), | |
| 497 | - ), | |
| 498 | - 'IR' => array( // Iran States. | |
| 499 | - 'KHZ' => __( 'Khuzestan (خوزستان)', 'invoicing' ), | |
| 500 | - 'THR' => __( 'Tehran (تهران)', 'invoicing' ), | |
| 501 | - 'ILM' => __( 'Ilaam (ایلام)', 'invoicing' ), | |
| 502 | - 'BHR' => __( 'Bushehr (بوشهر)', 'invoicing' ), | |
| 503 | - 'ADL' => __( 'Ardabil (اردبیل)', 'invoicing' ), | |
| 504 | - 'ESF' => __( 'Isfahan (اصفهان)', 'invoicing' ), | |
| 505 | - 'YZD' => __( 'Yazd (یزد)', 'invoicing' ), | |
| 506 | - 'KRH' => __( 'Kermanshah (کرمانشاه)', 'invoicing' ), | |
| 507 | - 'KRN' => __( 'Kerman (کرمان)', 'invoicing' ), | |
| 508 | - 'HDN' => __( 'Hamadan (همدان)', 'invoicing' ), | |
| 509 | - 'GZN' => __( 'Ghazvin (قزوین)', 'invoicing' ), | |
| 510 | - 'ZJN' => __( 'Zanjan (زنجان)', 'invoicing' ), | |
| 511 | - 'LRS' => __( 'Luristan (لرستان)', 'invoicing' ), | |
| 512 | - 'ABZ' => __( 'Alborz (البرز)', 'invoicing' ), | |
| 513 | - 'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'invoicing' ), | |
| 514 | - 'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'invoicing' ), | |
| 515 | - 'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'invoicing' ), | |
| 516 | - 'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'invoicing' ), | |
| 517 | - 'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'invoicing' ), | |
| 518 | - 'NKH' => __( 'North Khorasan (خراسان شمالی)', 'invoicing' ), | |
| 519 | - 'SMN' => __( 'Semnan (سمنان)', 'invoicing' ), | |
| 520 | - 'FRS' => __( 'Fars (فارس)', 'invoicing' ), | |
| 521 | - 'QHM' => __( 'Qom (قم)', 'invoicing' ), | |
| 522 | - 'KRD' => __( 'Kurdistan / کردستان)', 'invoicing' ), | |
| 523 | - 'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'invoicing' ), | |
| 524 | - 'GLS' => __( 'Golestan (گلستان)', 'invoicing' ), | |
| 525 | - 'GIL' => __( 'Gilan (گیلان)', 'invoicing' ), | |
| 526 | - 'MZN' => __( 'Mazandaran (مازندران)', 'invoicing' ), | |
| 527 | - 'MKZ' => __( 'Markazi (مرکزی)', 'invoicing' ), | |
| 528 | - 'HRZ' => __( 'Hormozgan (هرمزگان)', 'invoicing' ), | |
| 529 | - 'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'invoicing' ), | |
| 530 | - ), | |
| 531 | - 'IS' => array(), | |
| 532 | - 'IT' => array( // Italy Provinces. | |
| 533 | - 'AG' => __( 'Agrigento', 'invoicing' ), | |
| 534 | - 'AL' => __( 'Alessandria', 'invoicing' ), | |
| 535 | - 'AN' => __( 'Ancona', 'invoicing' ), | |
| 536 | - 'AO' => __( 'Aosta', 'invoicing' ), | |
| 537 | - 'AR' => __( 'Arezzo', 'invoicing' ), | |
| 538 | - 'AP' => __( 'Ascoli Piceno', 'invoicing' ), | |
| 539 | - 'AT' => __( 'Asti', 'invoicing' ), | |
| 540 | - 'AV' => __( 'Avellino', 'invoicing' ), | |
| 541 | - 'BA' => __( 'Bari', 'invoicing' ), | |
| 542 | - 'BT' => __( 'Barletta-Andria-Trani', 'invoicing' ), | |
| 543 | - 'BL' => __( 'Belluno', 'invoicing' ), | |
| 544 | - 'BN' => __( 'Benevento', 'invoicing' ), | |
| 545 | - 'BG' => __( 'Bergamo', 'invoicing' ), | |
| 546 | - 'BI' => __( 'Biella', 'invoicing' ), | |
| 547 | - 'BO' => __( 'Bologna', 'invoicing' ), | |
| 548 | - 'BZ' => __( 'Bolzano', 'invoicing' ), | |
| 549 | - 'BS' => __( 'Brescia', 'invoicing' ), | |
| 550 | - 'BR' => __( 'Brindisi', 'invoicing' ), | |
| 551 | - 'CA' => __( 'Cagliari', 'invoicing' ), | |
| 552 | - 'CL' => __( 'Caltanissetta', 'invoicing' ), | |
| 553 | - 'CB' => __( 'Campobasso', 'invoicing' ), | |
| 554 | - 'CE' => __( 'Caserta', 'invoicing' ), | |
| 555 | - 'CT' => __( 'Catania', 'invoicing' ), | |
| 556 | - 'CZ' => __( 'Catanzaro', 'invoicing' ), | |
| 557 | - 'CH' => __( 'Chieti', 'invoicing' ), | |
| 558 | - 'CO' => __( 'Como', 'invoicing' ), | |
| 559 | - 'CS' => __( 'Cosenza', 'invoicing' ), | |
| 560 | - 'CR' => __( 'Cremona', 'invoicing' ), | |
| 561 | - 'KR' => __( 'Crotone', 'invoicing' ), | |
| 562 | - 'CN' => __( 'Cuneo', 'invoicing' ), | |
| 563 | - 'EN' => __( 'Enna', 'invoicing' ), | |
| 564 | - 'FM' => __( 'Fermo', 'invoicing' ), | |
| 565 | - 'FE' => __( 'Ferrara', 'invoicing' ), | |
| 566 | - 'FI' => __( 'Firenze', 'invoicing' ), | |
| 567 | - 'FG' => __( 'Foggia', 'invoicing' ), | |
| 568 | - 'FC' => __( 'Forlì-Cesena', 'invoicing' ), | |
| 569 | - 'FR' => __( 'Frosinone', 'invoicing' ), | |
| 570 | - 'GE' => __( 'Genova', 'invoicing' ), | |
| 571 | - 'GO' => __( 'Gorizia', 'invoicing' ), | |
| 572 | - 'GR' => __( 'Grosseto', 'invoicing' ), | |
| 573 | - 'IM' => __( 'Imperia', 'invoicing' ), | |
| 574 | - 'IS' => __( 'Isernia', 'invoicing' ), | |
| 575 | - 'SP' => __( 'La Spezia', 'invoicing' ), | |
| 576 | - 'AQ' => __( "L'Aquila", 'invoicing' ), | |
| 577 | - 'LT' => __( 'Latina', 'invoicing' ), | |
| 578 | - 'LE' => __( 'Lecce', 'invoicing' ), | |
| 579 | - 'LC' => __( 'Lecco', 'invoicing' ), | |
| 580 | - 'LI' => __( 'Livorno', 'invoicing' ), | |
| 581 | - 'LO' => __( 'Lodi', 'invoicing' ), | |
| 582 | - 'LU' => __( 'Lucca', 'invoicing' ), | |
| 583 | - 'MC' => __( 'Macerata', 'invoicing' ), | |
| 584 | - 'MN' => __( 'Mantova', 'invoicing' ), | |
| 585 | - 'MS' => __( 'Massa-Carrara', 'invoicing' ), | |
| 586 | - 'MT' => __( 'Matera', 'invoicing' ), | |
| 587 | - 'ME' => __( 'Messina', 'invoicing' ), | |
| 588 | - 'MI' => __( 'Milano', 'invoicing' ), | |
| 589 | - 'MO' => __( 'Modena', 'invoicing' ), | |
| 590 | - 'MB' => __( 'Monza e della Brianza', 'invoicing' ), | |
| 591 | - 'NA' => __( 'Napoli', 'invoicing' ), | |
| 592 | - 'NO' => __( 'Novara', 'invoicing' ), | |
| 593 | - 'NU' => __( 'Nuoro', 'invoicing' ), | |
| 594 | - 'OR' => __( 'Oristano', 'invoicing' ), | |
| 595 | - 'PD' => __( 'Padova', 'invoicing' ), | |
| 596 | - 'PA' => __( 'Palermo', 'invoicing' ), | |
| 597 | - 'PR' => __( 'Parma', 'invoicing' ), | |
| 598 | - 'PV' => __( 'Pavia', 'invoicing' ), | |
| 599 | - 'PG' => __( 'Perugia', 'invoicing' ), | |
| 600 | - 'PU' => __( 'Pesaro e Urbino', 'invoicing' ), | |
| 601 | - 'PE' => __( 'Pescara', 'invoicing' ), | |
| 602 | - 'PC' => __( 'Piacenza', 'invoicing' ), | |
| 603 | - 'PI' => __( 'Pisa', 'invoicing' ), | |
| 604 | - 'PT' => __( 'Pistoia', 'invoicing' ), | |
| 605 | - 'PN' => __( 'Pordenone', 'invoicing' ), | |
| 606 | - 'PZ' => __( 'Potenza', 'invoicing' ), | |
| 607 | - 'PO' => __( 'Prato', 'invoicing' ), | |
| 608 | - 'RG' => __( 'Ragusa', 'invoicing' ), | |
| 609 | - 'RA' => __( 'Ravenna', 'invoicing' ), | |
| 610 | - 'RC' => __( 'Reggio Calabria', 'invoicing' ), | |
| 611 | - 'RE' => __( 'Reggio Emilia', 'invoicing' ), | |
| 612 | - 'RI' => __( 'Rieti', 'invoicing' ), | |
| 613 | - 'RN' => __( 'Rimini', 'invoicing' ), | |
| 614 | - 'RM' => __( 'Roma', 'invoicing' ), | |
| 615 | - 'RO' => __( 'Rovigo', 'invoicing' ), | |
| 616 | - 'SA' => __( 'Salerno', 'invoicing' ), | |
| 617 | - 'SS' => __( 'Sassari', 'invoicing' ), | |
| 618 | - 'SV' => __( 'Savona', 'invoicing' ), | |
| 619 | - 'SI' => __( 'Siena', 'invoicing' ), | |
| 620 | - 'SR' => __( 'Siracusa', 'invoicing' ), | |
| 621 | - 'SO' => __( 'Sondrio', 'invoicing' ), | |
| 622 | - 'SU' => __( 'Sud Sardegna', 'invoicing' ), | |
| 623 | - 'TA' => __( 'Taranto', 'invoicing' ), | |
| 624 | - 'TE' => __( 'Teramo', 'invoicing' ), | |
| 625 | - 'TR' => __( 'Terni', 'invoicing' ), | |
| 626 | - 'TO' => __( 'Torino', 'invoicing' ), | |
| 627 | - 'TP' => __( 'Trapani', 'invoicing' ), | |
| 628 | - 'TN' => __( 'Trento', 'invoicing' ), | |
| 629 | - 'TV' => __( 'Treviso', 'invoicing' ), | |
| 630 | - 'TS' => __( 'Trieste', 'invoicing' ), | |
| 631 | - 'UD' => __( 'Udine', 'invoicing' ), | |
| 632 | - 'VA' => __( 'Varese', 'invoicing' ), | |
| 633 | - 'VE' => __( 'Venezia', 'invoicing' ), | |
| 634 | - 'VB' => __( 'Verbano-Cusio-Ossola', 'invoicing' ), | |
| 635 | - 'VC' => __( 'Vercelli', 'invoicing' ), | |
| 636 | - 'VR' => __( 'Verona', 'invoicing' ), | |
| 637 | - 'VV' => __( 'Vibo Valentia', 'invoicing' ), | |
| 638 | - 'VI' => __( 'Vicenza', 'invoicing' ), | |
| 639 | - 'VT' => __( 'Viterbo', 'invoicing' ), | |
| 640 | - ), | |
| 641 | - 'IL' => array(), | |
| 642 | - 'IM' => array(), | |
| 17 | + 'AF' => array(), | |
| 18 | + 'AO' => array( // Angola states. | |
| 19 | + 'BGO' => __( 'Bengo', 'invoicing' ), | |
| 20 | + 'BLU' => __( 'Benguela', 'invoicing' ), | |
| 21 | + 'BIE' => __( 'Bié', 'invoicing' ), | |
| 22 | + 'CAB' => __( 'Cabinda', 'invoicing' ), | |
| 23 | + 'CNN' => __( 'Cunene', 'invoicing' ), | |
| 24 | + 'HUA' => __( 'Huambo', 'invoicing' ), | |
| 25 | + 'HUI' => __( 'Huíla', 'invoicing' ), | |
| 26 | + 'CCU' => __( 'Kuando Kubango', 'invoicing' ), | |
| 27 | + 'CNO' => __( 'Kwanza-Norte', 'invoicing' ), | |
| 28 | + 'CUS' => __( 'Kwanza-Sul', 'invoicing' ), | |
| 29 | + 'LUA' => __( 'Luanda', 'invoicing' ), | |
| 30 | + 'LNO' => __( 'Lunda-Norte', 'invoicing' ), | |
| 31 | + 'LSU' => __( 'Lunda-Sul', 'invoicing' ), | |
| 32 | + 'MAL' => __( 'Malanje', 'invoicing' ), | |
| 33 | + 'MOX' => __( 'Moxico', 'invoicing' ), | |
| 34 | + 'NAM' => __( 'Namibe', 'invoicing' ), | |
| 35 | + 'UIG' => __( 'Uíge', 'invoicing' ), | |
| 36 | + 'ZAI' => __( 'Zaire', 'invoicing' ), | |
| 37 | + ), | |
| 38 | + 'AR' => array( // Argentinian provinces. | |
| 39 | + 'C' => __( 'Ciudad Autónoma de Buenos Aires', 'invoicing' ), | |
| 40 | + 'B' => __( 'Buenos Aires', 'invoicing' ), | |
| 41 | + 'K' => __( 'Catamarca', 'invoicing' ), | |
| 42 | + 'H' => __( 'Chaco', 'invoicing' ), | |
| 43 | + 'U' => __( 'Chubut', 'invoicing' ), | |
| 44 | + 'X' => __( 'Córdoba', 'invoicing' ), | |
| 45 | + 'W' => __( 'Corrientes', 'invoicing' ), | |
| 46 | + 'E' => __( 'Entre Ríos', 'invoicing' ), | |
| 47 | + 'P' => __( 'Formosa', 'invoicing' ), | |
| 48 | + 'Y' => __( 'Jujuy', 'invoicing' ), | |
| 49 | + 'L' => __( 'La Pampa', 'invoicing' ), | |
| 50 | + 'F' => __( 'La Rioja', 'invoicing' ), | |
| 51 | + 'M' => __( 'Mendoza', 'invoicing' ), | |
| 52 | + 'N' => __( 'Misiones', 'invoicing' ), | |
| 53 | + 'Q' => __( 'Neuquén', 'invoicing' ), | |
| 54 | + 'R' => __( 'Río Negro', 'invoicing' ), | |
| 55 | + 'A' => __( 'Salta', 'invoicing' ), | |
| 56 | + 'J' => __( 'San Juan', 'invoicing' ), | |
| 57 | + 'D' => __( 'San Luis', 'invoicing' ), | |
| 58 | + 'Z' => __( 'Santa Cruz', 'invoicing' ), | |
| 59 | + 'S' => __( 'Santa Fe', 'invoicing' ), | |
| 60 | + 'G' => __( 'Santiago del Estero', 'invoicing' ), | |
| 61 | + 'V' => __( 'Tierra del Fuego', 'invoicing' ), | |
| 62 | + 'T' => __( 'Tucumán', 'invoicing' ), | |
| 63 | + ), | |
| 64 | + 'AT' => array(), | |
| 65 | + 'AU' => array( // Australian states. | |
| 66 | + 'ACT' => __( 'Australian Capital Territory', 'invoicing' ), | |
| 67 | + 'NSW' => __( 'New South Wales', 'invoicing' ), | |
| 68 | + 'NT' => __( 'Northern Territory', 'invoicing' ), | |
| 69 | + 'QLD' => __( 'Queensland', 'invoicing' ), | |
| 70 | + 'SA' => __( 'South Australia', 'invoicing' ), | |
| 71 | + 'TAS' => __( 'Tasmania', 'invoicing' ), | |
| 72 | + 'VIC' => __( 'Victoria', 'invoicing' ), | |
| 73 | + 'WA' => __( 'Western Australia', 'invoicing' ), | |
| 74 | + ), | |
| 75 | + 'AX' => array(), | |
| 76 | + 'BD' => array( // Bangladeshi states (districts). | |
| 77 | + 'BD-05' => __( 'Bagerhat', 'invoicing' ), | |
| 78 | + 'BD-01' => __( 'Bandarban', 'invoicing' ), | |
| 79 | + 'BD-02' => __( 'Barguna', 'invoicing' ), | |
| 80 | + 'BD-06' => __( 'Barishal', 'invoicing' ), | |
| 81 | + 'BD-07' => __( 'Bhola', 'invoicing' ), | |
| 82 | + 'BD-03' => __( 'Bogura', 'invoicing' ), | |
| 83 | + 'BD-04' => __( 'Brahmanbaria', 'invoicing' ), | |
| 84 | + 'BD-09' => __( 'Chandpur', 'invoicing' ), | |
| 85 | + 'BD-10' => __( 'Chattogram', 'invoicing' ), | |
| 86 | + 'BD-12' => __( 'Chuadanga', 'invoicing' ), | |
| 87 | + 'BD-11' => __( "Cox's Bazar", 'invoicing' ), | |
| 88 | + 'BD-08' => __( 'Cumilla', 'invoicing' ), | |
| 89 | + 'BD-13' => __( 'Dhaka', 'invoicing' ), | |
| 90 | + 'BD-14' => __( 'Dinajpur', 'invoicing' ), | |
| 91 | + 'BD-15' => __( 'Faridpur ', 'invoicing' ), | |
| 92 | + 'BD-16' => __( 'Feni', 'invoicing' ), | |
| 93 | + 'BD-19' => __( 'Gaibandha', 'invoicing' ), | |
| 94 | + 'BD-18' => __( 'Gazipur', 'invoicing' ), | |
| 95 | + 'BD-17' => __( 'Gopalganj', 'invoicing' ), | |
| 96 | + 'BD-20' => __( 'Habiganj', 'invoicing' ), | |
| 97 | + 'BD-21' => __( 'Jamalpur', 'invoicing' ), | |
| 98 | + 'BD-22' => __( 'Jashore', 'invoicing' ), | |
| 99 | + 'BD-25' => __( 'Jhalokati', 'invoicing' ), | |
| 100 | + 'BD-23' => __( 'Jhenaidah', 'invoicing' ), | |
| 101 | + 'BD-24' => __( 'Joypurhat', 'invoicing' ), | |
| 102 | + 'BD-29' => __( 'Khagrachhari', 'invoicing' ), | |
| 103 | + 'BD-27' => __( 'Khulna', 'invoicing' ), | |
| 104 | + 'BD-26' => __( 'Kishoreganj', 'invoicing' ), | |
| 105 | + 'BD-28' => __( 'Kurigram', 'invoicing' ), | |
| 106 | + 'BD-30' => __( 'Kushtia', 'invoicing' ), | |
| 107 | + 'BD-31' => __( 'Lakshmipur', 'invoicing' ), | |
| 108 | + 'BD-32' => __( 'Lalmonirhat', 'invoicing' ), | |
| 109 | + 'BD-36' => __( 'Madaripur', 'invoicing' ), | |
| 110 | + 'BD-37' => __( 'Magura', 'invoicing' ), | |
| 111 | + 'BD-33' => __( 'Manikganj ', 'invoicing' ), | |
| 112 | + 'BD-39' => __( 'Meherpur', 'invoicing' ), | |
| 113 | + 'BD-38' => __( 'Moulvibazar', 'invoicing' ), | |
| 114 | + 'BD-35' => __( 'Munshiganj', 'invoicing' ), | |
| 115 | + 'BD-34' => __( 'Mymensingh', 'invoicing' ), | |
| 116 | + 'BD-48' => __( 'Naogaon', 'invoicing' ), | |
| 117 | + 'BD-43' => __( 'Narail', 'invoicing' ), | |
| 118 | + 'BD-40' => __( 'Narayanganj', 'invoicing' ), | |
| 119 | + 'BD-42' => __( 'Narsingdi', 'invoicing' ), | |
| 120 | + 'BD-44' => __( 'Natore', 'invoicing' ), | |
| 121 | + 'BD-45' => __( 'Nawabganj', 'invoicing' ), | |
| 122 | + 'BD-41' => __( 'Netrakona', 'invoicing' ), | |
| 123 | + 'BD-46' => __( 'Nilphamari', 'invoicing' ), | |
| 124 | + 'BD-47' => __( 'Noakhali', 'invoicing' ), | |
| 125 | + 'BD-49' => __( 'Pabna', 'invoicing' ), | |
| 126 | + 'BD-52' => __( 'Panchagarh', 'invoicing' ), | |
| 127 | + 'BD-51' => __( 'Patuakhali', 'invoicing' ), | |
| 128 | + 'BD-50' => __( 'Pirojpur', 'invoicing' ), | |
| 129 | + 'BD-53' => __( 'Rajbari', 'invoicing' ), | |
| 130 | + 'BD-54' => __( 'Rajshahi', 'invoicing' ), | |
| 131 | + 'BD-56' => __( 'Rangamati', 'invoicing' ), | |
| 132 | + 'BD-55' => __( 'Rangpur', 'invoicing' ), | |
| 133 | + 'BD-58' => __( 'Satkhira', 'invoicing' ), | |
| 134 | + 'BD-62' => __( 'Shariatpur', 'invoicing' ), | |
| 135 | + 'BD-57' => __( 'Sherpur', 'invoicing' ), | |
| 136 | + 'BD-59' => __( 'Sirajganj', 'invoicing' ), | |
| 137 | + 'BD-61' => __( 'Sunamganj', 'invoicing' ), | |
| 138 | + 'BD-60' => __( 'Sylhet', 'invoicing' ), | |
| 139 | + 'BD-63' => __( 'Tangail', 'invoicing' ), | |
| 140 | + 'BD-64' => __( 'Thakurgaon', 'invoicing' ), | |
| 141 | + ), | |
| 142 | + 'BE' => array(), | |
| 143 | + 'BG' => array( // Bulgarian states. | |
| 144 | + 'BG-01' => __( 'Blagoevgrad', 'invoicing' ), | |
| 145 | + 'BG-02' => __( 'Burgas', 'invoicing' ), | |
| 146 | + 'BG-08' => __( 'Dobrich', 'invoicing' ), | |
| 147 | + 'BG-07' => __( 'Gabrovo', 'invoicing' ), | |
| 148 | + 'BG-26' => __( 'Haskovo', 'invoicing' ), | |
| 149 | + 'BG-09' => __( 'Kardzhali', 'invoicing' ), | |
| 150 | + 'BG-10' => __( 'Kyustendil', 'invoicing' ), | |
| 151 | + 'BG-11' => __( 'Lovech', 'invoicing' ), | |
| 152 | + 'BG-12' => __( 'Montana', 'invoicing' ), | |
| 153 | + 'BG-13' => __( 'Pazardzhik', 'invoicing' ), | |
| 154 | + 'BG-14' => __( 'Pernik', 'invoicing' ), | |
| 155 | + 'BG-15' => __( 'Pleven', 'invoicing' ), | |
| 156 | + 'BG-16' => __( 'Plovdiv', 'invoicing' ), | |
| 157 | + 'BG-17' => __( 'Razgrad', 'invoicing' ), | |
| 158 | + 'BG-18' => __( 'Ruse', 'invoicing' ), | |
| 159 | + 'BG-27' => __( 'Shumen', 'invoicing' ), | |
| 160 | + 'BG-19' => __( 'Silistra', 'invoicing' ), | |
| 161 | + 'BG-20' => __( 'Sliven', 'invoicing' ), | |
| 162 | + 'BG-21' => __( 'Smolyan', 'invoicing' ), | |
| 163 | + 'BG-23' => __( 'Sofia', 'invoicing' ), | |
| 164 | + 'BG-22' => __( 'Sofia-Grad', 'invoicing' ), | |
| 165 | + 'BG-24' => __( 'Stara Zagora', 'invoicing' ), | |
| 166 | + 'BG-25' => __( 'Targovishte', 'invoicing' ), | |
| 167 | + 'BG-03' => __( 'Varna', 'invoicing' ), | |
| 168 | + 'BG-04' => __( 'Veliko Tarnovo', 'invoicing' ), | |
| 169 | + 'BG-05' => __( 'Vidin', 'invoicing' ), | |
| 170 | + 'BG-06' => __( 'Vratsa', 'invoicing' ), | |
| 171 | + 'BG-28' => __( 'Yambol', 'invoicing' ), | |
| 172 | + ), | |
| 173 | + 'BH' => array(), | |
| 174 | + 'BI' => array(), | |
| 175 | + 'BO' => array( // Bolivian states. | |
| 176 | + 'B' => __( 'Chuquisaca', 'invoicing' ), | |
| 177 | + 'H' => __( 'Beni', 'invoicing' ), | |
| 178 | + 'C' => __( 'Cochabamba', 'invoicing' ), | |
| 179 | + 'L' => __( 'La Paz', 'invoicing' ), | |
| 180 | + 'O' => __( 'Oruro', 'invoicing' ), | |
| 181 | + 'N' => __( 'Pando', 'invoicing' ), | |
| 182 | + 'P' => __( 'Potosí', 'invoicing' ), | |
| 183 | + 'S' => __( 'Santa Cruz', 'invoicing' ), | |
| 184 | + 'T' => __( 'Tarija', 'invoicing' ), | |
| 185 | + ), | |
| 186 | + 'BR' => array( // Brazillian states. | |
| 187 | + 'AC' => __( 'Acre', 'invoicing' ), | |
| 188 | + 'AL' => __( 'Alagoas', 'invoicing' ), | |
| 189 | + 'AP' => __( 'Amapá', 'invoicing' ), | |
| 190 | + 'AM' => __( 'Amazonas', 'invoicing' ), | |
| 191 | + 'BA' => __( 'Bahia', 'invoicing' ), | |
| 192 | + 'CE' => __( 'Ceará', 'invoicing' ), | |
| 193 | + 'DF' => __( 'Distrito Federal', 'invoicing' ), | |
| 194 | + 'ES' => __( 'Espírito Santo', 'invoicing' ), | |
| 195 | + 'GO' => __( 'Goiás', 'invoicing' ), | |
| 196 | + 'MA' => __( 'Maranhão', 'invoicing' ), | |
| 197 | + 'MT' => __( 'Mato Grosso', 'invoicing' ), | |
| 198 | + 'MS' => __( 'Mato Grosso do Sul', 'invoicing' ), | |
| 199 | + 'MG' => __( 'Minas Gerais', 'invoicing' ), | |
| 200 | + 'PA' => __( 'Pará', 'invoicing' ), | |
| 201 | + 'PB' => __( 'Paraíba', 'invoicing' ), | |
| 202 | + 'PR' => __( 'Paraná', 'invoicing' ), | |
| 203 | + 'PE' => __( 'Pernambuco', 'invoicing' ), | |
| 204 | + 'PI' => __( 'Piauí', 'invoicing' ), | |
| 205 | + 'RJ' => __( 'Rio de Janeiro', 'invoicing' ), | |
| 206 | + 'RN' => __( 'Rio Grande do Norte', 'invoicing' ), | |
| 207 | + 'RS' => __( 'Rio Grande do Sul', 'invoicing' ), | |
| 208 | + 'RO' => __( 'Rondônia', 'invoicing' ), | |
| 209 | + 'RR' => __( 'Roraima', 'invoicing' ), | |
| 210 | + 'SC' => __( 'Santa Catarina', 'invoicing' ), | |
| 211 | + 'SP' => __( 'São Paulo', 'invoicing' ), | |
| 212 | + 'SE' => __( 'Sergipe', 'invoicing' ), | |
| 213 | + 'TO' => __( 'Tocantins', 'invoicing' ), | |
| 214 | + ), | |
| 215 | + 'CA' => array( // Canadian states. | |
| 216 | + 'AB' => __( 'Alberta', 'invoicing' ), | |
| 217 | + 'BC' => __( 'British Columbia', 'invoicing' ), | |
| 218 | + 'MB' => __( 'Manitoba', 'invoicing' ), | |
| 219 | + 'NB' => __( 'New Brunswick', 'invoicing' ), | |
| 220 | + 'NL' => __( 'Newfoundland and Labrador', 'invoicing' ), | |
| 221 | + 'NT' => __( 'Northwest Territories', 'invoicing' ), | |
| 222 | + 'NS' => __( 'Nova Scotia', 'invoicing' ), | |
| 223 | + 'NU' => __( 'Nunavut', 'invoicing' ), | |
| 224 | + 'ON' => __( 'Ontario', 'invoicing' ), | |
| 225 | + 'PE' => __( 'Prince Edward Island', 'invoicing' ), | |
| 226 | + 'QC' => __( 'Quebec', 'invoicing' ), | |
| 227 | + 'SK' => __( 'Saskatchewan', 'invoicing' ), | |
| 228 | + 'YT' => __( 'Yukon Territory', 'invoicing' ), | |
| 229 | + ), | |
| 230 | + 'CH' => array( // Cantons of Switzerland. | |
| 231 | + 'AG' => __( 'Aargau', 'invoicing' ), | |
| 232 | + 'AR' => __( 'Appenzell Ausserrhoden', 'invoicing' ), | |
| 233 | + 'AI' => __( 'Appenzell Innerrhoden', 'invoicing' ), | |
| 234 | + 'BL' => __( 'Basel-Landschaft', 'invoicing' ), | |
| 235 | + 'BS' => __( 'Basel-Stadt', 'invoicing' ), | |
| 236 | + 'BE' => __( 'Bern', 'invoicing' ), | |
| 237 | + 'FR' => __( 'Fribourg', 'invoicing' ), | |
| 238 | + 'GE' => __( 'Geneva', 'invoicing' ), | |
| 239 | + 'GL' => __( 'Glarus', 'invoicing' ), | |
| 240 | + 'GR' => __( 'Graubünden', 'invoicing' ), | |
| 241 | + 'JU' => __( 'Jura', 'invoicing' ), | |
| 242 | + 'LU' => __( 'Luzern', 'invoicing' ), | |
| 243 | + 'NE' => __( 'Neuchâtel', 'invoicing' ), | |
| 244 | + 'NW' => __( 'Nidwalden', 'invoicing' ), | |
| 245 | + 'OW' => __( 'Obwalden', 'invoicing' ), | |
| 246 | + 'SH' => __( 'Schaffhausen', 'invoicing' ), | |
| 247 | + 'SZ' => __( 'Schwyz', 'invoicing' ), | |
| 248 | + 'SO' => __( 'Solothurn', 'invoicing' ), | |
| 249 | + 'SG' => __( 'St. Gallen', 'invoicing' ), | |
| 250 | + 'TG' => __( 'Thurgau', 'invoicing' ), | |
| 251 | + 'TI' => __( 'Ticino', 'invoicing' ), | |
| 252 | + 'UR' => __( 'Uri', 'invoicing' ), | |
| 253 | + 'VS' => __( 'Valais', 'invoicing' ), | |
| 254 | + 'VD' => __( 'Vaud', 'invoicing' ), | |
| 255 | + 'ZG' => __( 'Zug', 'invoicing' ), | |
| 256 | + 'ZH' => __( 'Zürich', 'invoicing' ), | |
| 257 | + ), | |
| 258 | + 'CN' => array( // Chinese states. | |
| 259 | + 'CN1' => __( 'Yunnan / 云南', 'invoicing' ), | |
| 260 | + 'CN2' => __( 'Beijing / 北京', 'invoicing' ), | |
| 261 | + 'CN3' => __( 'Tianjin / 天津', 'invoicing' ), | |
| 262 | + 'CN4' => __( 'Hebei / 河北', 'invoicing' ), | |
| 263 | + 'CN5' => __( 'Shanxi / 山西', 'invoicing' ), | |
| 264 | + 'CN6' => __( 'Inner Mongolia / 內蒙古', 'invoicing' ), | |
| 265 | + 'CN7' => __( 'Liaoning / 辽宁', 'invoicing' ), | |
| 266 | + 'CN8' => __( 'Jilin / 吉林', 'invoicing' ), | |
| 267 | + 'CN9' => __( 'Heilongjiang / 黑龙江', 'invoicing' ), | |
| 268 | + 'CN10' => __( 'Shanghai / 上海', 'invoicing' ), | |
| 269 | + 'CN11' => __( 'Jiangsu / 江苏', 'invoicing' ), | |
| 270 | + 'CN12' => __( 'Zhejiang / 浙江', 'invoicing' ), | |
| 271 | + 'CN13' => __( 'Anhui / 安徽', 'invoicing' ), | |
| 272 | + 'CN14' => __( 'Fujian / 福建', 'invoicing' ), | |
| 273 | + 'CN15' => __( 'Jiangxi / 江西', 'invoicing' ), | |
| 274 | + 'CN16' => __( 'Shandong / 山东', 'invoicing' ), | |
| 275 | + 'CN17' => __( 'Henan / 河南', 'invoicing' ), | |
| 276 | + 'CN18' => __( 'Hubei / 湖北', 'invoicing' ), | |
| 277 | + 'CN19' => __( 'Hunan / 湖南', 'invoicing' ), | |
| 278 | + 'CN20' => __( 'Guangdong / 广东', 'invoicing' ), | |
| 279 | + 'CN21' => __( 'Guangxi Zhuang / 广西壮族', 'invoicing' ), | |
| 280 | + 'CN22' => __( 'Hainan / 海南', 'invoicing' ), | |
| 281 | + 'CN23' => __( 'Chongqing / 重庆', 'invoicing' ), | |
| 282 | + 'CN24' => __( 'Sichuan / 四川', 'invoicing' ), | |
| 283 | + 'CN25' => __( 'Guizhou / 贵州', 'invoicing' ), | |
| 284 | + 'CN26' => __( 'Shaanxi / 陕西', 'invoicing' ), | |
| 285 | + 'CN27' => __( 'Gansu / 甘肃', 'invoicing' ), | |
| 286 | + 'CN28' => __( 'Qinghai / 青海', 'invoicing' ), | |
| 287 | + 'CN29' => __( 'Ningxia Hui / 宁夏', 'invoicing' ), | |
| 288 | + 'CN30' => __( 'Macao / 澳门', 'invoicing' ), | |
| 289 | + 'CN31' => __( 'Tibet / 西藏', 'invoicing' ), | |
| 290 | + 'CN32' => __( 'Xinjiang / 新疆', 'invoicing' ), | |
| 291 | + ), | |
| 292 | + 'CZ' => array(), | |
| 293 | + 'DE' => array(), | |
| 294 | + 'DK' => array(), | |
| 295 | + 'EE' => array(), | |
| 296 | + 'ES' => array( // Spanish states. | |
| 297 | + 'C' => __( 'A Coruña', 'invoicing' ), | |
| 298 | + 'VI' => __( 'Araba/Álava', 'invoicing' ), | |
| 299 | + 'AB' => __( 'Albacete', 'invoicing' ), | |
| 300 | + 'A' => __( 'Alicante', 'invoicing' ), | |
| 301 | + 'AL' => __( 'Almería', 'invoicing' ), | |
| 302 | + 'O' => __( 'Asturias', 'invoicing' ), | |
| 303 | + 'AV' => __( 'Ávila', 'invoicing' ), | |
| 304 | + 'BA' => __( 'Badajoz', 'invoicing' ), | |
| 305 | + 'PM' => __( 'Baleares', 'invoicing' ), | |
| 306 | + 'B' => __( 'Barcelona', 'invoicing' ), | |
| 307 | + 'BU' => __( 'Burgos', 'invoicing' ), | |
| 308 | + 'CC' => __( 'Cáceres', 'invoicing' ), | |
| 309 | + 'CA' => __( 'Cádiz', 'invoicing' ), | |
| 310 | + 'S' => __( 'Cantabria', 'invoicing' ), | |
| 311 | + 'CS' => __( 'Castellón', 'invoicing' ), | |
| 312 | + 'CE' => __( 'Ceuta', 'invoicing' ), | |
| 313 | + 'CR' => __( 'Ciudad Real', 'invoicing' ), | |
| 314 | + 'CO' => __( 'Córdoba', 'invoicing' ), | |
| 315 | + 'CU' => __( 'Cuenca', 'invoicing' ), | |
| 316 | + 'GI' => __( 'Girona', 'invoicing' ), | |
| 317 | + 'GR' => __( 'Granada', 'invoicing' ), | |
| 318 | + 'GU' => __( 'Guadalajara', 'invoicing' ), | |
| 319 | + 'SS' => __( 'Gipuzkoa', 'invoicing' ), | |
| 320 | + 'H' => __( 'Huelva', 'invoicing' ), | |
| 321 | + 'HU' => __( 'Huesca', 'invoicing' ), | |
| 322 | + 'J' => __( 'Jaén', 'invoicing' ), | |
| 323 | + 'LO' => __( 'La Rioja', 'invoicing' ), | |
| 324 | + 'GC' => __( 'Las Palmas', 'invoicing' ), | |
| 325 | + 'LE' => __( 'León', 'invoicing' ), | |
| 326 | + 'L' => __( 'Lleida', 'invoicing' ), | |
| 327 | + 'LU' => __( 'Lugo', 'invoicing' ), | |
| 328 | + 'M' => __( 'Madrid', 'invoicing' ), | |
| 329 | + 'MA' => __( 'Málaga', 'invoicing' ), | |
| 330 | + 'ML' => __( 'Melilla', 'invoicing' ), | |
| 331 | + 'MU' => __( 'Murcia', 'invoicing' ), | |
| 332 | + 'NA' => __( 'Navarra', 'invoicing' ), | |
| 333 | + 'OR' => __( 'Ourense', 'invoicing' ), | |
| 334 | + 'P' => __( 'Palencia', 'invoicing' ), | |
| 335 | + 'PO' => __( 'Pontevedra', 'invoicing' ), | |
| 336 | + 'SA' => __( 'Salamanca', 'invoicing' ), | |
| 337 | + 'TF' => __( 'Santa Cruz de Tenerife', 'invoicing' ), | |
| 338 | + 'SG' => __( 'Segovia', 'invoicing' ), | |
| 339 | + 'SE' => __( 'Sevilla', 'invoicing' ), | |
| 340 | + 'SO' => __( 'Soria', 'invoicing' ), | |
| 341 | + 'T' => __( 'Tarragona', 'invoicing' ), | |
| 342 | + 'TE' => __( 'Teruel', 'invoicing' ), | |
| 343 | + 'TO' => __( 'Toledo', 'invoicing' ), | |
| 344 | + 'V' => __( 'Valencia', 'invoicing' ), | |
| 345 | + 'VA' => __( 'Valladolid', 'invoicing' ), | |
| 346 | + 'BI' => __( 'Bizkaia', 'invoicing' ), | |
| 347 | + 'ZA' => __( 'Zamora', 'invoicing' ), | |
| 348 | + 'Z' => __( 'Zaragoza', 'invoicing' ), | |
| 349 | + ), | |
| 350 | + 'FI' => array(), | |
| 351 | + 'FR' => array(), | |
| 352 | + 'GP' => array(), | |
| 353 | + 'GR' => array( // Greek Regions. | |
| 354 | + 'I' => __( 'Αττική', 'invoicing' ), | |
| 355 | + 'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'invoicing' ), | |
| 356 | + 'B' => __( 'Κεντρική Μακεδονία', 'invoicing' ), | |
| 357 | + 'C' => __( 'Δυτική Μακεδονία', 'invoicing' ), | |
| 358 | + 'D' => __( 'Ήπειρος', 'invoicing' ), | |
| 359 | + 'E' => __( 'Θεσσαλία', 'invoicing' ), | |
| 360 | + 'F' => __( 'Ιόνιοι Νήσοι', 'invoicing' ), | |
| 361 | + 'G' => __( 'Δυτική Ελλάδα', 'invoicing' ), | |
| 362 | + 'H' => __( 'Στερεά Ελλάδα', 'invoicing' ), | |
| 363 | + 'J' => __( 'Πελοπόννησος', 'invoicing' ), | |
| 364 | + 'K' => __( 'Βόρειο Αιγαίο', 'invoicing' ), | |
| 365 | + 'L' => __( 'Νότιο Αιγαίο', 'invoicing' ), | |
| 366 | + 'M' => __( 'Κρήτη', 'invoicing' ), | |
| 367 | + ), | |
| 368 | + 'GF' => array(), | |
| 369 | + 'HK' => array( // Hong Kong states. | |
| 370 | + 'HONG KONG' => __( 'Hong Kong Island', 'invoicing' ), | |
| 371 | + 'KOWLOON' => __( 'Kowloon', 'invoicing' ), | |
| 372 | + 'NEW TERRITORIES' => __( 'New Territories', 'invoicing' ), | |
| 373 | + ), | |
| 374 | + 'HU' => array( // Hungary states. | |
| 375 | + 'BK' => __( 'Bács-Kiskun', 'invoicing' ), | |
| 376 | + 'BE' => __( 'Békés', 'invoicing' ), | |
| 377 | + 'BA' => __( 'Baranya', 'invoicing' ), | |
| 378 | + 'BZ' => __( 'Borsod-Abaúj-Zemplén', 'invoicing' ), | |
| 379 | + 'BU' => __( 'Budapest', 'invoicing' ), | |
| 380 | + 'CS' => __( 'Csongrád', 'invoicing' ), | |
| 381 | + 'FE' => __( 'Fejér', 'invoicing' ), | |
| 382 | + 'GS' => __( 'Győr-Moson-Sopron', 'invoicing' ), | |
| 383 | + 'HB' => __( 'Hajdú-Bihar', 'invoicing' ), | |
| 384 | + 'HE' => __( 'Heves', 'invoicing' ), | |
| 385 | + 'JN' => __( 'Jász-Nagykun-Szolnok', 'invoicing' ), | |
| 386 | + 'KE' => __( 'Komárom-Esztergom', 'invoicing' ), | |
| 387 | + 'NO' => __( 'Nógrád', 'invoicing' ), | |
| 388 | + 'PE' => __( 'Pest', 'invoicing' ), | |
| 389 | + 'SO' => __( 'Somogy', 'invoicing' ), | |
| 390 | + 'SZ' => __( 'Szabolcs-Szatmár-Bereg', 'invoicing' ), | |
| 391 | + 'TO' => __( 'Tolna', 'invoicing' ), | |
| 392 | + 'VA' => __( 'Vas', 'invoicing' ), | |
| 393 | + 'VE' => __( 'Veszprém', 'invoicing' ), | |
| 394 | + 'ZA' => __( 'Zala', 'invoicing' ), | |
| 395 | + ), | |
| 396 | + 'ID' => array( // Indonesia Provinces. | |
| 397 | + 'AC' => __( 'Daerah Istimewa Aceh', 'invoicing' ), | |
| 398 | + 'SU' => __( 'Sumatera Utara', 'invoicing' ), | |
| 399 | + 'SB' => __( 'Sumatera Barat', 'invoicing' ), | |
| 400 | + 'RI' => __( 'Riau', 'invoicing' ), | |
| 401 | + 'KR' => __( 'Kepulauan Riau', 'invoicing' ), | |
| 402 | + 'JA' => __( 'Jambi', 'invoicing' ), | |
| 403 | + 'SS' => __( 'Sumatera Selatan', 'invoicing' ), | |
| 404 | + 'BB' => __( 'Bangka Belitung', 'invoicing' ), | |
| 405 | + 'BE' => __( 'Bengkulu', 'invoicing' ), | |
| 406 | + 'LA' => __( 'Lampung', 'invoicing' ), | |
| 407 | + 'JK' => __( 'DKI Jakarta', 'invoicing' ), | |
| 408 | + 'JB' => __( 'Jawa Barat', 'invoicing' ), | |
| 409 | + 'BT' => __( 'Banten', 'invoicing' ), | |
| 410 | + 'JT' => __( 'Jawa Tengah', 'invoicing' ), | |
| 411 | + 'JI' => __( 'Jawa Timur', 'invoicing' ), | |
| 412 | + 'YO' => __( 'Daerah Istimewa Yogyakarta', 'invoicing' ), | |
| 413 | + 'BA' => __( 'Bali', 'invoicing' ), | |
| 414 | + 'NB' => __( 'Nusa Tenggara Barat', 'invoicing' ), | |
| 415 | + 'NT' => __( 'Nusa Tenggara Timur', 'invoicing' ), | |
| 416 | + 'KB' => __( 'Kalimantan Barat', 'invoicing' ), | |
| 417 | + 'KT' => __( 'Kalimantan Tengah', 'invoicing' ), | |
| 418 | + 'KI' => __( 'Kalimantan Timur', 'invoicing' ), | |
| 419 | + 'KS' => __( 'Kalimantan Selatan', 'invoicing' ), | |
| 420 | + 'KU' => __( 'Kalimantan Utara', 'invoicing' ), | |
| 421 | + 'SA' => __( 'Sulawesi Utara', 'invoicing' ), | |
| 422 | + 'ST' => __( 'Sulawesi Tengah', 'invoicing' ), | |
| 423 | + 'SG' => __( 'Sulawesi Tenggara', 'invoicing' ), | |
| 424 | + 'SR' => __( 'Sulawesi Barat', 'invoicing' ), | |
| 425 | + 'SN' => __( 'Sulawesi Selatan', 'invoicing' ), | |
| 426 | + 'GO' => __( 'Gorontalo', 'invoicing' ), | |
| 427 | + 'MA' => __( 'Maluku', 'invoicing' ), | |
| 428 | + 'MU' => __( 'Maluku Utara', 'invoicing' ), | |
| 429 | + 'PA' => __( 'Papua', 'invoicing' ), | |
| 430 | + 'PB' => __( 'Papua Barat', 'invoicing' ), | |
| 431 | + ), | |
| 432 | + 'IE' => array( // Republic of Ireland. | |
| 433 | + 'CW' => __( 'Carlow', 'invoicing' ), | |
| 434 | + 'CN' => __( 'Cavan', 'invoicing' ), | |
| 435 | + 'CE' => __( 'Clare', 'invoicing' ), | |
| 436 | + 'CO' => __( 'Cork', 'invoicing' ), | |
| 437 | + 'DL' => __( 'Donegal', 'invoicing' ), | |
| 438 | + 'D' => __( 'Dublin', 'invoicing' ), | |
| 439 | + 'G' => __( 'Galway', 'invoicing' ), | |
| 440 | + 'KY' => __( 'Kerry', 'invoicing' ), | |
| 441 | + 'KE' => __( 'Kildare', 'invoicing' ), | |
| 442 | + 'KK' => __( 'Kilkenny', 'invoicing' ), | |
| 443 | + 'LS' => __( 'Laois', 'invoicing' ), | |
| 444 | + 'LM' => __( 'Leitrim', 'invoicing' ), | |
| 445 | + 'LK' => __( 'Limerick', 'invoicing' ), | |
| 446 | + 'LD' => __( 'Longford', 'invoicing' ), | |
| 447 | + 'LH' => __( 'Louth', 'invoicing' ), | |
| 448 | + 'MO' => __( 'Mayo', 'invoicing' ), | |
| 449 | + 'MH' => __( 'Meath', 'invoicing' ), | |
| 450 | + 'MN' => __( 'Monaghan', 'invoicing' ), | |
| 451 | + 'OY' => __( 'Offaly', 'invoicing' ), | |
| 452 | + 'RN' => __( 'Roscommon', 'invoicing' ), | |
| 453 | + 'SO' => __( 'Sligo', 'invoicing' ), | |
| 454 | + 'TA' => __( 'Tipperary', 'invoicing' ), | |
| 455 | + 'WD' => __( 'Waterford', 'invoicing' ), | |
| 456 | + 'WH' => __( 'Westmeath', 'invoicing' ), | |
| 457 | + 'WX' => __( 'Wexford', 'invoicing' ), | |
| 458 | + 'WW' => __( 'Wicklow', 'invoicing' ), | |
| 459 | + ), | |
| 460 | + 'IN' => array( // Indian states. | |
| 461 | + 'AP' => __( 'Andhra Pradesh', 'invoicing' ), | |
| 462 | + 'AR' => __( 'Arunachal Pradesh', 'invoicing' ), | |
| 463 | + 'AS' => __( 'Assam', 'invoicing' ), | |
| 464 | + 'BR' => __( 'Bihar', 'invoicing' ), | |
| 465 | + 'CT' => __( 'Chhattisgarh', 'invoicing' ), | |
| 466 | + 'GA' => __( 'Goa', 'invoicing' ), | |
| 467 | + 'GJ' => __( 'Gujarat', 'invoicing' ), | |
| 468 | + 'HR' => __( 'Haryana', 'invoicing' ), | |
| 469 | + 'HP' => __( 'Himachal Pradesh', 'invoicing' ), | |
| 470 | + 'JK' => __( 'Jammu and Kashmir', 'invoicing' ), | |
| 471 | + 'JH' => __( 'Jharkhand', 'invoicing' ), | |
| 472 | + 'KA' => __( 'Karnataka', 'invoicing' ), | |
| 473 | + 'KL' => __( 'Kerala', 'invoicing' ), | |
| 474 | + 'MP' => __( 'Madhya Pradesh', 'invoicing' ), | |
| 475 | + 'MH' => __( 'Maharashtra', 'invoicing' ), | |
| 476 | + 'MN' => __( 'Manipur', 'invoicing' ), | |
| 477 | + 'ML' => __( 'Meghalaya', 'invoicing' ), | |
| 478 | + 'MZ' => __( 'Mizoram', 'invoicing' ), | |
| 479 | + 'NL' => __( 'Nagaland', 'invoicing' ), | |
| 480 | + 'OR' => __( 'Orissa', 'invoicing' ), | |
| 481 | + 'PB' => __( 'Punjab', 'invoicing' ), | |
| 482 | + 'RJ' => __( 'Rajasthan', 'invoicing' ), | |
| 483 | + 'SK' => __( 'Sikkim', 'invoicing' ), | |
| 484 | + 'TN' => __( 'Tamil Nadu', 'invoicing' ), | |
| 485 | + 'TS' => __( 'Telangana', 'invoicing' ), | |
| 486 | + 'TR' => __( 'Tripura', 'invoicing' ), | |
| 487 | + 'UK' => __( 'Uttarakhand', 'invoicing' ), | |
| 488 | + 'UP' => __( 'Uttar Pradesh', 'invoicing' ), | |
| 489 | + 'WB' => __( 'West Bengal', 'invoicing' ), | |
| 490 | + 'AN' => __( 'Andaman and Nicobar Islands', 'invoicing' ), | |
| 491 | + 'CH' => __( 'Chandigarh', 'invoicing' ), | |
| 492 | + 'DN' => __( 'Dadra and Nagar Haveli', 'invoicing' ), | |
| 493 | + 'DD' => __( 'Daman and Diu', 'invoicing' ), | |
| 494 | + 'DL' => __( 'Delhi', 'invoicing' ), | |
| 495 | + 'LD' => __( 'Lakshadeep', 'invoicing' ), | |
| 496 | + 'PY' => __( 'Pondicherry (Puducherry)', 'invoicing' ), | |
| 497 | + ), | |
| 498 | + 'IR' => array( // Iran States. | |
| 499 | + 'KHZ' => __( 'Khuzestan (خوزستان)', 'invoicing' ), | |
| 500 | + 'THR' => __( 'Tehran (تهران)', 'invoicing' ), | |
| 501 | + 'ILM' => __( 'Ilaam (ایلام)', 'invoicing' ), | |
| 502 | + 'BHR' => __( 'Bushehr (بوشهر)', 'invoicing' ), | |
| 503 | + 'ADL' => __( 'Ardabil (اردبیل)', 'invoicing' ), | |
| 504 | + 'ESF' => __( 'Isfahan (اصفهان)', 'invoicing' ), | |
| 505 | + 'YZD' => __( 'Yazd (یزد)', 'invoicing' ), | |
| 506 | + 'KRH' => __( 'Kermanshah (کرمانشاه)', 'invoicing' ), | |
| 507 | + 'KRN' => __( 'Kerman (کرمان)', 'invoicing' ), | |
| 508 | + 'HDN' => __( 'Hamadan (همدان)', 'invoicing' ), | |
| 509 | + 'GZN' => __( 'Ghazvin (قزوین)', 'invoicing' ), | |
| 510 | + 'ZJN' => __( 'Zanjan (زنجان)', 'invoicing' ), | |
| 511 | + 'LRS' => __( 'Luristan (لرستان)', 'invoicing' ), | |
| 512 | + 'ABZ' => __( 'Alborz (البرز)', 'invoicing' ), | |
| 513 | + 'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'invoicing' ), | |
| 514 | + 'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'invoicing' ), | |
| 515 | + 'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'invoicing' ), | |
| 516 | + 'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'invoicing' ), | |
| 517 | + 'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'invoicing' ), | |
| 518 | + 'NKH' => __( 'North Khorasan (خراسان شمالی)', 'invoicing' ), | |
| 519 | + 'SMN' => __( 'Semnan (سمنان)', 'invoicing' ), | |
| 520 | + 'FRS' => __( 'Fars (فارس)', 'invoicing' ), | |
| 521 | + 'QHM' => __( 'Qom (قم)', 'invoicing' ), | |
| 522 | + 'KRD' => __( 'Kurdistan / کردستان)', 'invoicing' ), | |
| 523 | + 'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'invoicing' ), | |
| 524 | + 'GLS' => __( 'Golestan (گلستان)', 'invoicing' ), | |
| 525 | + 'GIL' => __( 'Gilan (گیلان)', 'invoicing' ), | |
| 526 | + 'MZN' => __( 'Mazandaran (مازندران)', 'invoicing' ), | |
| 527 | + 'MKZ' => __( 'Markazi (مرکزی)', 'invoicing' ), | |
| 528 | + 'HRZ' => __( 'Hormozgan (هرمزگان)', 'invoicing' ), | |
| 529 | + 'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'invoicing' ), | |
| 530 | + ), | |
| 531 | + 'IS' => array(), | |
| 532 | + 'IT' => array( // Italy Provinces. | |
| 533 | + 'AG' => __( 'Agrigento', 'invoicing' ), | |
| 534 | + 'AL' => __( 'Alessandria', 'invoicing' ), | |
| 535 | + 'AN' => __( 'Ancona', 'invoicing' ), | |
| 536 | + 'AO' => __( 'Aosta', 'invoicing' ), | |
| 537 | + 'AR' => __( 'Arezzo', 'invoicing' ), | |
| 538 | + 'AP' => __( 'Ascoli Piceno', 'invoicing' ), | |
| 539 | + 'AT' => __( 'Asti', 'invoicing' ), | |
| 540 | + 'AV' => __( 'Avellino', 'invoicing' ), | |
| 541 | + 'BA' => __( 'Bari', 'invoicing' ), | |
| 542 | + 'BT' => __( 'Barletta-Andria-Trani', 'invoicing' ), | |
| 543 | + 'BL' => __( 'Belluno', 'invoicing' ), | |
| 544 | + 'BN' => __( 'Benevento', 'invoicing' ), | |
| 545 | + 'BG' => __( 'Bergamo', 'invoicing' ), | |
| 546 | + 'BI' => __( 'Biella', 'invoicing' ), | |
| 547 | + 'BO' => __( 'Bologna', 'invoicing' ), | |
| 548 | + 'BZ' => __( 'Bolzano', 'invoicing' ), | |
| 549 | + 'BS' => __( 'Brescia', 'invoicing' ), | |
| 550 | + 'BR' => __( 'Brindisi', 'invoicing' ), | |
| 551 | + 'CA' => __( 'Cagliari', 'invoicing' ), | |
| 552 | + 'CL' => __( 'Caltanissetta', 'invoicing' ), | |
| 553 | + 'CB' => __( 'Campobasso', 'invoicing' ), | |
| 554 | + 'CE' => __( 'Caserta', 'invoicing' ), | |
| 555 | + 'CT' => __( 'Catania', 'invoicing' ), | |
| 556 | + 'CZ' => __( 'Catanzaro', 'invoicing' ), | |
| 557 | + 'CH' => __( 'Chieti', 'invoicing' ), | |
| 558 | + 'CO' => __( 'Como', 'invoicing' ), | |
| 559 | + 'CS' => __( 'Cosenza', 'invoicing' ), | |
| 560 | + 'CR' => __( 'Cremona', 'invoicing' ), | |
| 561 | + 'KR' => __( 'Crotone', 'invoicing' ), | |
| 562 | + 'CN' => __( 'Cuneo', 'invoicing' ), | |
| 563 | + 'EN' => __( 'Enna', 'invoicing' ), | |
| 564 | + 'FM' => __( 'Fermo', 'invoicing' ), | |
| 565 | + 'FE' => __( 'Ferrara', 'invoicing' ), | |
| 566 | + 'FI' => __( 'Firenze', 'invoicing' ), | |
| 567 | + 'FG' => __( 'Foggia', 'invoicing' ), | |
| 568 | + 'FC' => __( 'Forlì-Cesena', 'invoicing' ), | |
| 569 | + 'FR' => __( 'Frosinone', 'invoicing' ), | |
| 570 | + 'GE' => __( 'Genova', 'invoicing' ), | |
| 571 | + 'GO' => __( 'Gorizia', 'invoicing' ), | |
| 572 | + 'GR' => __( 'Grosseto', 'invoicing' ), | |
| 573 | + 'IM' => __( 'Imperia', 'invoicing' ), | |
| 574 | + 'IS' => __( 'Isernia', 'invoicing' ), | |
| 575 | + 'SP' => __( 'La Spezia', 'invoicing' ), | |
| 576 | + 'AQ' => __( "L'Aquila", 'invoicing' ), | |
| 577 | + 'LT' => __( 'Latina', 'invoicing' ), | |
| 578 | + 'LE' => __( 'Lecce', 'invoicing' ), | |
| 579 | + 'LC' => __( 'Lecco', 'invoicing' ), | |
| 580 | + 'LI' => __( 'Livorno', 'invoicing' ), | |
| 581 | + 'LO' => __( 'Lodi', 'invoicing' ), | |
| 582 | + 'LU' => __( 'Lucca', 'invoicing' ), | |
| 583 | + 'MC' => __( 'Macerata', 'invoicing' ), | |
| 584 | + 'MN' => __( 'Mantova', 'invoicing' ), | |
| 585 | + 'MS' => __( 'Massa-Carrara', 'invoicing' ), | |
| 586 | + 'MT' => __( 'Matera', 'invoicing' ), | |
| 587 | + 'ME' => __( 'Messina', 'invoicing' ), | |
| 588 | + 'MI' => __( 'Milano', 'invoicing' ), | |
| 589 | + 'MO' => __( 'Modena', 'invoicing' ), | |
| 590 | + 'MB' => __( 'Monza e della Brianza', 'invoicing' ), | |
| 591 | + 'NA' => __( 'Napoli', 'invoicing' ), | |
| 592 | + 'NO' => __( 'Novara', 'invoicing' ), | |
| 593 | + 'NU' => __( 'Nuoro', 'invoicing' ), | |
| 594 | + 'OR' => __( 'Oristano', 'invoicing' ), | |
| 595 | + 'PD' => __( 'Padova', 'invoicing' ), | |
| 596 | + 'PA' => __( 'Palermo', 'invoicing' ), | |
| 597 | + 'PR' => __( 'Parma', 'invoicing' ), | |
| 598 | + 'PV' => __( 'Pavia', 'invoicing' ), | |
| 599 | + 'PG' => __( 'Perugia', 'invoicing' ), | |
| 600 | + 'PU' => __( 'Pesaro e Urbino', 'invoicing' ), | |
| 601 | + 'PE' => __( 'Pescara', 'invoicing' ), | |
| 602 | + 'PC' => __( 'Piacenza', 'invoicing' ), | |
| 603 | + 'PI' => __( 'Pisa', 'invoicing' ), | |
| 604 | + 'PT' => __( 'Pistoia', 'invoicing' ), | |
| 605 | + 'PN' => __( 'Pordenone', 'invoicing' ), | |
| 606 | + 'PZ' => __( 'Potenza', 'invoicing' ), | |
| 607 | + 'PO' => __( 'Prato', 'invoicing' ), | |
| 608 | + 'RG' => __( 'Ragusa', 'invoicing' ), | |
| 609 | + 'RA' => __( 'Ravenna', 'invoicing' ), | |
| 610 | + 'RC' => __( 'Reggio Calabria', 'invoicing' ), | |
| 611 | + 'RE' => __( 'Reggio Emilia', 'invoicing' ), | |
| 612 | + 'RI' => __( 'Rieti', 'invoicing' ), | |
| 613 | + 'RN' => __( 'Rimini', 'invoicing' ), | |
| 614 | + 'RM' => __( 'Roma', 'invoicing' ), | |
| 615 | + 'RO' => __( 'Rovigo', 'invoicing' ), | |
| 616 | + 'SA' => __( 'Salerno', 'invoicing' ), | |
| 617 | + 'SS' => __( 'Sassari', 'invoicing' ), | |
| 618 | + 'SV' => __( 'Savona', 'invoicing' ), | |
| 619 | + 'SI' => __( 'Siena', 'invoicing' ), | |
| 620 | + 'SR' => __( 'Siracusa', 'invoicing' ), | |
| 621 | + 'SO' => __( 'Sondrio', 'invoicing' ), | |
| 622 | + 'SU' => __( 'Sud Sardegna', 'invoicing' ), | |
| 623 | + 'TA' => __( 'Taranto', 'invoicing' ), | |
| 624 | + 'TE' => __( 'Teramo', 'invoicing' ), | |
| 625 | + 'TR' => __( 'Terni', 'invoicing' ), | |
| 626 | + 'TO' => __( 'Torino', 'invoicing' ), | |
| 627 | + 'TP' => __( 'Trapani', 'invoicing' ), | |
| 628 | + 'TN' => __( 'Trento', 'invoicing' ), | |
| 629 | + 'TV' => __( 'Treviso', 'invoicing' ), | |
| 630 | + 'TS' => __( 'Trieste', 'invoicing' ), | |
| 631 | + 'UD' => __( 'Udine', 'invoicing' ), | |
| 632 | + 'VA' => __( 'Varese', 'invoicing' ), | |
| 633 | + 'VE' => __( 'Venezia', 'invoicing' ), | |
| 634 | + 'VB' => __( 'Verbano-Cusio-Ossola', 'invoicing' ), | |
| 635 | + 'VC' => __( 'Vercelli', 'invoicing' ), | |
| 636 | + 'VR' => __( 'Verona', 'invoicing' ), | |
| 637 | + 'VV' => __( 'Vibo Valentia', 'invoicing' ), | |
| 638 | + 'VI' => __( 'Vicenza', 'invoicing' ), | |
| 639 | + 'VT' => __( 'Viterbo', 'invoicing' ), | |
| 640 | + ), | |
| 641 | + 'IL' => array(), | |
| 642 | + 'IM' => array(), | |
| 643 | 643 | |
| 644 | - /** | |
| 645 | - * Japan States. | |
| 646 | - * | |
| 647 | - * English notation of prefectures conform to the notation of Japan Post. | |
| 648 | - * The suffix corresponds with the Japanese translation file. | |
| 649 | - */ | |
| 650 | - 'JP' => array( | |
| 651 | - 'JP01' => __( 'Hokkaido', 'invoicing' ), | |
| 652 | - 'JP02' => __( 'Aomori', 'invoicing' ), | |
| 653 | - 'JP03' => __( 'Iwate', 'invoicing' ), | |
| 654 | - 'JP04' => __( 'Miyagi', 'invoicing' ), | |
| 655 | - 'JP05' => __( 'Akita', 'invoicing' ), | |
| 656 | - 'JP06' => __( 'Yamagata', 'invoicing' ), | |
| 657 | - 'JP07' => __( 'Fukushima', 'invoicing' ), | |
| 658 | - 'JP08' => __( 'Ibaraki', 'invoicing' ), | |
| 659 | - 'JP09' => __( 'Tochigi', 'invoicing' ), | |
| 660 | - 'JP10' => __( 'Gunma', 'invoicing' ), | |
| 661 | - 'JP11' => __( 'Saitama', 'invoicing' ), | |
| 662 | - 'JP12' => __( 'Chiba', 'invoicing' ), | |
| 663 | - 'JP13' => __( 'Tokyo', 'invoicing' ), | |
| 664 | - 'JP14' => __( 'Kanagawa', 'invoicing' ), | |
| 665 | - 'JP15' => __( 'Niigata', 'invoicing' ), | |
| 666 | - 'JP16' => __( 'Toyama', 'invoicing' ), | |
| 667 | - 'JP17' => __( 'Ishikawa', 'invoicing' ), | |
| 668 | - 'JP18' => __( 'Fukui', 'invoicing' ), | |
| 669 | - 'JP19' => __( 'Yamanashi', 'invoicing' ), | |
| 670 | - 'JP20' => __( 'Nagano', 'invoicing' ), | |
| 671 | - 'JP21' => __( 'Gifu', 'invoicing' ), | |
| 672 | - 'JP22' => __( 'Shizuoka', 'invoicing' ), | |
| 673 | - 'JP23' => __( 'Aichi', 'invoicing' ), | |
| 674 | - 'JP24' => __( 'Mie', 'invoicing' ), | |
| 675 | - 'JP25' => __( 'Shiga', 'invoicing' ), | |
| 676 | - 'JP26' => __( 'Kyoto', 'invoicing' ), | |
| 677 | - 'JP27' => __( 'Osaka', 'invoicing' ), | |
| 678 | - 'JP28' => __( 'Hyogo', 'invoicing' ), | |
| 679 | - 'JP29' => __( 'Nara', 'invoicing' ), | |
| 680 | - 'JP30' => __( 'Wakayama', 'invoicing' ), | |
| 681 | - 'JP31' => __( 'Tottori', 'invoicing' ), | |
| 682 | - 'JP32' => __( 'Shimane', 'invoicing' ), | |
| 683 | - 'JP33' => __( 'Okayama', 'invoicing' ), | |
| 684 | - 'JP34' => __( 'Hiroshima', 'invoicing' ), | |
| 685 | - 'JP35' => __( 'Yamaguchi', 'invoicing' ), | |
| 686 | - 'JP36' => __( 'Tokushima', 'invoicing' ), | |
| 687 | - 'JP37' => __( 'Kagawa', 'invoicing' ), | |
| 688 | - 'JP38' => __( 'Ehime', 'invoicing' ), | |
| 689 | - 'JP39' => __( 'Kochi', 'invoicing' ), | |
| 690 | - 'JP40' => __( 'Fukuoka', 'invoicing' ), | |
| 691 | - 'JP41' => __( 'Saga', 'invoicing' ), | |
| 692 | - 'JP42' => __( 'Nagasaki', 'invoicing' ), | |
| 693 | - 'JP43' => __( 'Kumamoto', 'invoicing' ), | |
| 694 | - 'JP44' => __( 'Oita', 'invoicing' ), | |
| 695 | - 'JP45' => __( 'Miyazaki', 'invoicing' ), | |
| 696 | - 'JP46' => __( 'Kagoshima', 'invoicing' ), | |
| 697 | - 'JP47' => __( 'Okinawa', 'invoicing' ), | |
| 698 | - ), | |
| 699 | - 'KE' => array( // Kenya Counties. | |
| 700 | - '1' => __( 'Mombasa', 'invoicing' ), | |
| 701 | - '2' => __( 'Kwale', 'invoicing' ), | |
| 702 | - '3' => __( 'Kilifi', 'invoicing' ), | |
| 703 | - '4' => __( 'Tana River', 'invoicing' ), | |
| 704 | - '5' => __( 'Lamu', 'invoicing' ), | |
| 705 | - '6' => __( 'Taita-Taveta', 'invoicing' ), | |
| 706 | - '7' => __( 'Garissa', 'invoicing' ), | |
| 707 | - '8' => __( 'Wajir', 'invoicing' ), | |
| 708 | - '9' => __( 'Mandera', 'invoicing' ), | |
| 709 | - '10' => __( 'Marsabit', 'invoicing' ), | |
| 710 | - '11' => __( 'Isiolo', 'invoicing' ), | |
| 711 | - '12' => __( 'Meru', 'invoicing' ), | |
| 712 | - '13' => __( 'Tharaka-Nithi', 'invoicing' ), | |
| 713 | - '14' => __( 'Embu', 'invoicing' ), | |
| 714 | - '15' => __( 'Kitui', 'invoicing' ), | |
| 715 | - '16' => __( 'Machakos', 'invoicing' ), | |
| 716 | - '17' => __( 'Makueni', 'invoicing' ), | |
| 717 | - '18' => __( 'Nyandarua', 'invoicing' ), | |
| 718 | - '19' => __( 'Nyeri', 'invoicing' ), | |
| 719 | - '20' => __( 'Kirinyaga', 'invoicing' ), | |
| 720 | - '21' => __( "Murang'a", 'invoicing' ), | |
| 721 | - '22' => __( 'Kiambu', 'invoicing' ), | |
| 722 | - '23' => __( 'Turkana', 'invoicing' ), | |
| 723 | - '24' => __( 'West Pokot', 'invoicing' ), | |
| 724 | - '25' => __( 'Samburu', 'invoicing' ), | |
| 725 | - '26' => __( 'Trans-Nzoia', 'invoicing' ), | |
| 726 | - '27' => __( 'Uasin Gishu', 'invoicing' ), | |
| 727 | - '28' => __( 'Elgeyo-Marakwet', 'invoicing' ), | |
| 728 | - '29' => __( 'Nandi', 'invoicing' ), | |
| 729 | - '30' => __( 'Baringo', 'invoicing' ), | |
| 730 | - '31' => __( 'Laikipia', 'invoicing' ), | |
| 731 | - '32' => __( 'Nakuru', 'invoicing' ), | |
| 732 | - '33' => __( 'Narok', 'invoicing' ), | |
| 733 | - '34' => __( 'Kajiado', 'invoicing' ), | |
| 734 | - '35' => __( 'Kericho', 'invoicing' ), | |
| 735 | - '36' => __( 'Bomet', 'invoicing' ), | |
| 736 | - '37' => __( 'Kakamega', 'invoicing' ), | |
| 737 | - '38' => __( 'Vihiga', 'invoicing' ), | |
| 738 | - '39' => __( 'Bungoma', 'invoicing' ), | |
| 739 | - '40' => __( 'Busia', 'invoicing' ), | |
| 740 | - '41' => __( 'Siaya', 'invoicing' ), | |
| 741 | - '42' => __( 'Kisumu', 'invoicing' ), | |
| 742 | - '43' => __( 'Homa bay', 'invoicing' ), | |
| 743 | - '44' => __( 'Migori', 'invoicing' ), | |
| 744 | - '45' => __( 'Kisii', 'invoicing' ), | |
| 745 | - '46' => __( 'Nyamira', 'invoicing' ), | |
| 746 | - '47' => __( 'Nairobi', 'invoicing' ), | |
| 747 | - ), | |
| 748 | - 'KR' => array(), | |
| 749 | - 'KW' => array(), | |
| 750 | - 'LB' => array(), | |
| 751 | - 'LR' => array( // Liberia provinces. | |
| 752 | - 'BM' => __( 'Bomi', 'invoicing' ), | |
| 753 | - 'BN' => __( 'Bong', 'invoicing' ), | |
| 754 | - 'GA' => __( 'Gbarpolu', 'invoicing' ), | |
| 755 | - 'GB' => __( 'Grand Bassa', 'invoicing' ), | |
| 756 | - 'GC' => __( 'Grand Cape Mount', 'invoicing' ), | |
| 757 | - 'GG' => __( 'Grand Gedeh', 'invoicing' ), | |
| 758 | - 'GK' => __( 'Grand Kru', 'invoicing' ), | |
| 759 | - 'LO' => __( 'Lofa', 'invoicing' ), | |
| 760 | - 'MA' => __( 'Margibi', 'invoicing' ), | |
| 761 | - 'MY' => __( 'Maryland', 'invoicing' ), | |
| 762 | - 'MO' => __( 'Montserrado', 'invoicing' ), | |
| 763 | - 'NM' => __( 'Nimba', 'invoicing' ), | |
| 764 | - 'RV' => __( 'Rivercess', 'invoicing' ), | |
| 765 | - 'RG' => __( 'River Gee', 'invoicing' ), | |
| 766 | - 'SN' => __( 'Sinoe', 'invoicing' ), | |
| 767 | - ), | |
| 768 | - 'LU' => array(), | |
| 769 | - 'MD' => array( // Moldova states. | |
| 770 | - 'C' => __( 'Chișinău', 'invoicing' ), | |
| 771 | - 'BL' => __( 'Bălți', 'invoicing' ), | |
| 772 | - 'AN' => __( 'Anenii Noi', 'invoicing' ), | |
| 773 | - 'BS' => __( 'Basarabeasca', 'invoicing' ), | |
| 774 | - 'BR' => __( 'Briceni', 'invoicing' ), | |
| 775 | - 'CH' => __( 'Cahul', 'invoicing' ), | |
| 776 | - 'CT' => __( 'Cantemir', 'invoicing' ), | |
| 777 | - 'CL' => __( 'Călărași', 'invoicing' ), | |
| 778 | - 'CS' => __( 'Căușeni', 'invoicing' ), | |
| 779 | - 'CM' => __( 'Cimișlia', 'invoicing' ), | |
| 780 | - 'CR' => __( 'Criuleni', 'invoicing' ), | |
| 781 | - 'DN' => __( 'Dondușeni', 'invoicing' ), | |
| 782 | - 'DR' => __( 'Drochia', 'invoicing' ), | |
| 783 | - 'DB' => __( 'Dubăsari', 'invoicing' ), | |
| 784 | - 'ED' => __( 'Edineț', 'invoicing' ), | |
| 785 | - 'FL' => __( 'Fălești', 'invoicing' ), | |
| 786 | - 'FR' => __( 'Florești', 'invoicing' ), | |
| 787 | - 'GE' => __( 'UTA Găgăuzia', 'invoicing' ), | |
| 788 | - 'GL' => __( 'Glodeni', 'invoicing' ), | |
| 789 | - 'HN' => __( 'Hîncești', 'invoicing' ), | |
| 790 | - 'IL' => __( 'Ialoveni', 'invoicing' ), | |
| 791 | - 'LV' => __( 'Leova', 'invoicing' ), | |
| 792 | - 'NS' => __( 'Nisporeni', 'invoicing' ), | |
| 793 | - 'OC' => __( 'Ocnița', 'invoicing' ), | |
| 794 | - 'OR' => __( 'Orhei', 'invoicing' ), | |
| 795 | - 'RZ' => __( 'Rezina', 'invoicing' ), | |
| 796 | - 'RS' => __( 'Rîșcani', 'invoicing' ), | |
| 797 | - 'SG' => __( 'Sîngerei', 'invoicing' ), | |
| 798 | - 'SR' => __( 'Soroca', 'invoicing' ), | |
| 799 | - 'ST' => __( 'Strășeni', 'invoicing' ), | |
| 800 | - 'SD' => __( 'Șoldănești', 'invoicing' ), | |
| 801 | - 'SV' => __( 'Ștefan Vodă', 'invoicing' ), | |
| 802 | - 'TR' => __( 'Taraclia', 'invoicing' ), | |
| 803 | - 'TL' => __( 'Telenești', 'invoicing' ), | |
| 804 | - 'UN' => __( 'Ungheni', 'invoicing' ), | |
| 805 | - ), | |
| 806 | - 'MQ' => array(), | |
| 807 | - 'MT' => array(), | |
| 808 | - 'MX' => array( // Mexico States. | |
| 809 | - 'DF' => __( 'Ciudad de México', 'invoicing' ), | |
| 810 | - 'JA' => __( 'Jalisco', 'invoicing' ), | |
| 811 | - 'NL' => __( 'Nuevo León', 'invoicing' ), | |
| 812 | - 'AG' => __( 'Aguascalientes', 'invoicing' ), | |
| 813 | - 'BC' => __( 'Baja California', 'invoicing' ), | |
| 814 | - 'BS' => __( 'Baja California Sur', 'invoicing' ), | |
| 815 | - 'CM' => __( 'Campeche', 'invoicing' ), | |
| 816 | - 'CS' => __( 'Chiapas', 'invoicing' ), | |
| 817 | - 'CH' => __( 'Chihuahua', 'invoicing' ), | |
| 818 | - 'CO' => __( 'Coahuila', 'invoicing' ), | |
| 819 | - 'CL' => __( 'Colima', 'invoicing' ), | |
| 820 | - 'DG' => __( 'Durango', 'invoicing' ), | |
| 821 | - 'GT' => __( 'Guanajuato', 'invoicing' ), | |
| 822 | - 'GR' => __( 'Guerrero', 'invoicing' ), | |
| 823 | - 'HG' => __( 'Hidalgo', 'invoicing' ), | |
| 824 | - 'MX' => __( 'Estado de México', 'invoicing' ), | |
| 825 | - 'MI' => __( 'Michoacán', 'invoicing' ), | |
| 826 | - 'MO' => __( 'Morelos', 'invoicing' ), | |
| 827 | - 'NA' => __( 'Nayarit', 'invoicing' ), | |
| 828 | - 'OA' => __( 'Oaxaca', 'invoicing' ), | |
| 829 | - 'PU' => __( 'Puebla', 'invoicing' ), | |
| 830 | - 'QT' => __( 'Querétaro', 'invoicing' ), | |
| 831 | - 'QR' => __( 'Quintana Roo', 'invoicing' ), | |
| 832 | - 'SL' => __( 'San Luis Potosí', 'invoicing' ), | |
| 833 | - 'SI' => __( 'Sinaloa', 'invoicing' ), | |
| 834 | - 'SO' => __( 'Sonora', 'invoicing' ), | |
| 835 | - 'TB' => __( 'Tabasco', 'invoicing' ), | |
| 836 | - 'TM' => __( 'Tamaulipas', 'invoicing' ), | |
| 837 | - 'TL' => __( 'Tlaxcala', 'invoicing' ), | |
| 838 | - 'VE' => __( 'Veracruz', 'invoicing' ), | |
| 839 | - 'YU' => __( 'Yucatán', 'invoicing' ), | |
| 840 | - 'ZA' => __( 'Zacatecas', 'invoicing' ), | |
| 841 | - ), | |
| 842 | - 'MY' => array( // Malaysian states. | |
| 843 | - 'JHR' => __( 'Johor', 'invoicing' ), | |
| 844 | - 'KDH' => __( 'Kedah', 'invoicing' ), | |
| 845 | - 'KTN' => __( 'Kelantan', 'invoicing' ), | |
| 846 | - 'LBN' => __( 'Labuan', 'invoicing' ), | |
| 847 | - 'MLK' => __( 'Malacca (Melaka)', 'invoicing' ), | |
| 848 | - 'NSN' => __( 'Negeri Sembilan', 'invoicing' ), | |
| 849 | - 'PHG' => __( 'Pahang', 'invoicing' ), | |
| 850 | - 'PNG' => __( 'Penang (Pulau Pinang)', 'invoicing' ), | |
| 851 | - 'PRK' => __( 'Perak', 'invoicing' ), | |
| 852 | - 'PLS' => __( 'Perlis', 'invoicing' ), | |
| 853 | - 'SBH' => __( 'Sabah', 'invoicing' ), | |
| 854 | - 'SWK' => __( 'Sarawak', 'invoicing' ), | |
| 855 | - 'SGR' => __( 'Selangor', 'invoicing' ), | |
| 856 | - 'TRG' => __( 'Terengganu', 'invoicing' ), | |
| 857 | - 'PJY' => __( 'Putrajaya', 'invoicing' ), | |
| 858 | - 'KUL' => __( 'Kuala Lumpur', 'invoicing' ), | |
| 859 | - ), | |
| 860 | - 'NG' => array( // Nigerian provinces. | |
| 861 | - 'AB' => __( 'Abia', 'invoicing' ), | |
| 862 | - 'FC' => __( 'Abuja', 'invoicing' ), | |
| 863 | - 'AD' => __( 'Adamawa', 'invoicing' ), | |
| 864 | - 'AK' => __( 'Akwa Ibom', 'invoicing' ), | |
| 865 | - 'AN' => __( 'Anambra', 'invoicing' ), | |
| 866 | - 'BA' => __( 'Bauchi', 'invoicing' ), | |
| 867 | - 'BY' => __( 'Bayelsa', 'invoicing' ), | |
| 868 | - 'BE' => __( 'Benue', 'invoicing' ), | |
| 869 | - 'BO' => __( 'Borno', 'invoicing' ), | |
| 870 | - 'CR' => __( 'Cross River', 'invoicing' ), | |
| 871 | - 'DE' => __( 'Delta', 'invoicing' ), | |
| 872 | - 'EB' => __( 'Ebonyi', 'invoicing' ), | |
| 873 | - 'ED' => __( 'Edo', 'invoicing' ), | |
| 874 | - 'EK' => __( 'Ekiti', 'invoicing' ), | |
| 875 | - 'EN' => __( 'Enugu', 'invoicing' ), | |
| 876 | - 'GO' => __( 'Gombe', 'invoicing' ), | |
| 877 | - 'IM' => __( 'Imo', 'invoicing' ), | |
| 878 | - 'JI' => __( 'Jigawa', 'invoicing' ), | |
| 879 | - 'KD' => __( 'Kaduna', 'invoicing' ), | |
| 880 | - 'KN' => __( 'Kano', 'invoicing' ), | |
| 881 | - 'KT' => __( 'Katsina', 'invoicing' ), | |
| 882 | - 'KE' => __( 'Kebbi', 'invoicing' ), | |
| 883 | - 'KO' => __( 'Kogi', 'invoicing' ), | |
| 884 | - 'KW' => __( 'Kwara', 'invoicing' ), | |
| 885 | - 'LA' => __( 'Lagos', 'invoicing' ), | |
| 886 | - 'NA' => __( 'Nasarawa', 'invoicing' ), | |
| 887 | - 'NI' => __( 'Niger', 'invoicing' ), | |
| 888 | - 'OG' => __( 'Ogun', 'invoicing' ), | |
| 889 | - 'ON' => __( 'Ondo', 'invoicing' ), | |
| 890 | - 'OS' => __( 'Osun', 'invoicing' ), | |
| 891 | - 'OY' => __( 'Oyo', 'invoicing' ), | |
| 892 | - 'PL' => __( 'Plateau', 'invoicing' ), | |
| 893 | - 'RI' => __( 'Rivers', 'invoicing' ), | |
| 894 | - 'SO' => __( 'Sokoto', 'invoicing' ), | |
| 895 | - 'TA' => __( 'Taraba', 'invoicing' ), | |
| 896 | - 'YO' => __( 'Yobe', 'invoicing' ), | |
| 897 | - 'ZA' => __( 'Zamfara', 'invoicing' ), | |
| 898 | - ), | |
| 899 | - 'NL' => array(), | |
| 900 | - 'NO' => array(), | |
| 901 | - 'NP' => array( // Nepal states (Zones). | |
| 902 | - 'BAG' => __( 'Bagmati', 'invoicing' ), | |
| 903 | - 'BHE' => __( 'Bheri', 'invoicing' ), | |
| 904 | - 'DHA' => __( 'Dhaulagiri', 'invoicing' ), | |
| 905 | - 'GAN' => __( 'Gandaki', 'invoicing' ), | |
| 906 | - 'JAN' => __( 'Janakpur', 'invoicing' ), | |
| 907 | - 'KAR' => __( 'Karnali', 'invoicing' ), | |
| 908 | - 'KOS' => __( 'Koshi', 'invoicing' ), | |
| 909 | - 'LUM' => __( 'Lumbini', 'invoicing' ), | |
| 910 | - 'MAH' => __( 'Mahakali', 'invoicing' ), | |
| 911 | - 'MEC' => __( 'Mechi', 'invoicing' ), | |
| 912 | - 'NAR' => __( 'Narayani', 'invoicing' ), | |
| 913 | - 'RAP' => __( 'Rapti', 'invoicing' ), | |
| 914 | - 'SAG' => __( 'Sagarmatha', 'invoicing' ), | |
| 915 | - 'SET' => __( 'Seti', 'invoicing' ), | |
| 916 | - ), | |
| 917 | - 'NZ' => array( // New Zealand States. | |
| 918 | - 'NL' => __( 'Northland', 'invoicing' ), | |
| 919 | - 'AK' => __( 'Auckland', 'invoicing' ), | |
| 920 | - 'WA' => __( 'Waikato', 'invoicing' ), | |
| 921 | - 'BP' => __( 'Bay of Plenty', 'invoicing' ), | |
| 922 | - 'TK' => __( 'Taranaki', 'invoicing' ), | |
| 923 | - 'GI' => __( 'Gisborne', 'invoicing' ), | |
| 924 | - 'HB' => __( 'Hawke’s Bay', 'invoicing' ), | |
| 925 | - 'MW' => __( 'Manawatu-Wanganui', 'invoicing' ), | |
| 926 | - 'WE' => __( 'Wellington', 'invoicing' ), | |
| 927 | - 'NS' => __( 'Nelson', 'invoicing' ), | |
| 928 | - 'MB' => __( 'Marlborough', 'invoicing' ), | |
| 929 | - 'TM' => __( 'Tasman', 'invoicing' ), | |
| 930 | - 'WC' => __( 'West Coast', 'invoicing' ), | |
| 931 | - 'CT' => __( 'Canterbury', 'invoicing' ), | |
| 932 | - 'OT' => __( 'Otago', 'invoicing' ), | |
| 933 | - 'SL' => __( 'Southland', 'invoicing' ), | |
| 934 | - ), | |
| 935 | - 'PE' => array( // Peru states. | |
| 936 | - 'CAL' => __( 'El Callao', 'invoicing' ), | |
| 937 | - 'LMA' => __( 'Municipalidad Metropolitana de Lima', 'invoicing' ), | |
| 938 | - 'AMA' => __( 'Amazonas', 'invoicing' ), | |
| 939 | - 'ANC' => __( 'Ancash', 'invoicing' ), | |
| 940 | - 'APU' => __( 'Apurímac', 'invoicing' ), | |
| 941 | - 'ARE' => __( 'Arequipa', 'invoicing' ), | |
| 942 | - 'AYA' => __( 'Ayacucho', 'invoicing' ), | |
| 943 | - 'CAJ' => __( 'Cajamarca', 'invoicing' ), | |
| 944 | - 'CUS' => __( 'Cusco', 'invoicing' ), | |
| 945 | - 'HUV' => __( 'Huancavelica', 'invoicing' ), | |
| 946 | - 'HUC' => __( 'Huánuco', 'invoicing' ), | |
| 947 | - 'ICA' => __( 'Ica', 'invoicing' ), | |
| 948 | - 'JUN' => __( 'Junín', 'invoicing' ), | |
| 949 | - 'LAL' => __( 'La Libertad', 'invoicing' ), | |
| 950 | - 'LAM' => __( 'Lambayeque', 'invoicing' ), | |
| 951 | - 'LIM' => __( 'Lima', 'invoicing' ), | |
| 952 | - 'LOR' => __( 'Loreto', 'invoicing' ), | |
| 953 | - 'MDD' => __( 'Madre de Dios', 'invoicing' ), | |
| 954 | - 'MOQ' => __( 'Moquegua', 'invoicing' ), | |
| 955 | - 'PAS' => __( 'Pasco', 'invoicing' ), | |
| 956 | - 'PIU' => __( 'Piura', 'invoicing' ), | |
| 957 | - 'PUN' => __( 'Puno', 'invoicing' ), | |
| 958 | - 'SAM' => __( 'San Martín', 'invoicing' ), | |
| 959 | - 'TAC' => __( 'Tacna', 'invoicing' ), | |
| 960 | - 'TUM' => __( 'Tumbes', 'invoicing' ), | |
| 961 | - 'UCA' => __( 'Ucayali', 'invoicing' ), | |
| 962 | - ), | |
| 644 | + /** | |
| 645 | + * Japan States. | |
| 646 | + * | |
| 647 | + * English notation of prefectures conform to the notation of Japan Post. | |
| 648 | + * The suffix corresponds with the Japanese translation file. | |
| 649 | + */ | |
| 650 | + 'JP' => array( | |
| 651 | + 'JP01' => __( 'Hokkaido', 'invoicing' ), | |
| 652 | + 'JP02' => __( 'Aomori', 'invoicing' ), | |
| 653 | + 'JP03' => __( 'Iwate', 'invoicing' ), | |
| 654 | + 'JP04' => __( 'Miyagi', 'invoicing' ), | |
| 655 | + 'JP05' => __( 'Akita', 'invoicing' ), | |
| 656 | + 'JP06' => __( 'Yamagata', 'invoicing' ), | |
| 657 | + 'JP07' => __( 'Fukushima', 'invoicing' ), | |
| 658 | + 'JP08' => __( 'Ibaraki', 'invoicing' ), | |
| 659 | + 'JP09' => __( 'Tochigi', 'invoicing' ), | |
| 660 | + 'JP10' => __( 'Gunma', 'invoicing' ), | |
| 661 | + 'JP11' => __( 'Saitama', 'invoicing' ), | |
| 662 | + 'JP12' => __( 'Chiba', 'invoicing' ), | |
| 663 | + 'JP13' => __( 'Tokyo', 'invoicing' ), | |
| 664 | + 'JP14' => __( 'Kanagawa', 'invoicing' ), | |
| 665 | + 'JP15' => __( 'Niigata', 'invoicing' ), | |
| 666 | + 'JP16' => __( 'Toyama', 'invoicing' ), | |
| 667 | + 'JP17' => __( 'Ishikawa', 'invoicing' ), | |
| 668 | + 'JP18' => __( 'Fukui', 'invoicing' ), | |
| 669 | + 'JP19' => __( 'Yamanashi', 'invoicing' ), | |
| 670 | + 'JP20' => __( 'Nagano', 'invoicing' ), | |
| 671 | + 'JP21' => __( 'Gifu', 'invoicing' ), | |
| 672 | + 'JP22' => __( 'Shizuoka', 'invoicing' ), | |
| 673 | + 'JP23' => __( 'Aichi', 'invoicing' ), | |
| 674 | + 'JP24' => __( 'Mie', 'invoicing' ), | |
| 675 | + 'JP25' => __( 'Shiga', 'invoicing' ), | |
| 676 | + 'JP26' => __( 'Kyoto', 'invoicing' ), | |
| 677 | + 'JP27' => __( 'Osaka', 'invoicing' ), | |
| 678 | + 'JP28' => __( 'Hyogo', 'invoicing' ), | |
| 679 | + 'JP29' => __( 'Nara', 'invoicing' ), | |
| 680 | + 'JP30' => __( 'Wakayama', 'invoicing' ), | |
| 681 | + 'JP31' => __( 'Tottori', 'invoicing' ), | |
| 682 | + 'JP32' => __( 'Shimane', 'invoicing' ), | |
| 683 | + 'JP33' => __( 'Okayama', 'invoicing' ), | |
| 684 | + 'JP34' => __( 'Hiroshima', 'invoicing' ), | |
| 685 | + 'JP35' => __( 'Yamaguchi', 'invoicing' ), | |
| 686 | + 'JP36' => __( 'Tokushima', 'invoicing' ), | |
| 687 | + 'JP37' => __( 'Kagawa', 'invoicing' ), | |
| 688 | + 'JP38' => __( 'Ehime', 'invoicing' ), | |
| 689 | + 'JP39' => __( 'Kochi', 'invoicing' ), | |
| 690 | + 'JP40' => __( 'Fukuoka', 'invoicing' ), | |
| 691 | + 'JP41' => __( 'Saga', 'invoicing' ), | |
| 692 | + 'JP42' => __( 'Nagasaki', 'invoicing' ), | |
| 693 | + 'JP43' => __( 'Kumamoto', 'invoicing' ), | |
| 694 | + 'JP44' => __( 'Oita', 'invoicing' ), | |
| 695 | + 'JP45' => __( 'Miyazaki', 'invoicing' ), | |
| 696 | + 'JP46' => __( 'Kagoshima', 'invoicing' ), | |
| 697 | + 'JP47' => __( 'Okinawa', 'invoicing' ), | |
| 698 | + ), | |
| 699 | + 'KE' => array( // Kenya Counties. | |
| 700 | + '1' => __( 'Mombasa', 'invoicing' ), | |
| 701 | + '2' => __( 'Kwale', 'invoicing' ), | |
| 702 | + '3' => __( 'Kilifi', 'invoicing' ), | |
| 703 | + '4' => __( 'Tana River', 'invoicing' ), | |
| 704 | + '5' => __( 'Lamu', 'invoicing' ), | |
| 705 | + '6' => __( 'Taita-Taveta', 'invoicing' ), | |
| 706 | + '7' => __( 'Garissa', 'invoicing' ), | |
| 707 | + '8' => __( 'Wajir', 'invoicing' ), | |
| 708 | + '9' => __( 'Mandera', 'invoicing' ), | |
| 709 | + '10' => __( 'Marsabit', 'invoicing' ), | |
| 710 | + '11' => __( 'Isiolo', 'invoicing' ), | |
| 711 | + '12' => __( 'Meru', 'invoicing' ), | |
| 712 | + '13' => __( 'Tharaka-Nithi', 'invoicing' ), | |
| 713 | + '14' => __( 'Embu', 'invoicing' ), | |
| 714 | + '15' => __( 'Kitui', 'invoicing' ), | |
| 715 | + '16' => __( 'Machakos', 'invoicing' ), | |
| 716 | + '17' => __( 'Makueni', 'invoicing' ), | |
| 717 | + '18' => __( 'Nyandarua', 'invoicing' ), | |
| 718 | + '19' => __( 'Nyeri', 'invoicing' ), | |
| 719 | + '20' => __( 'Kirinyaga', 'invoicing' ), | |
| 720 | + '21' => __( "Murang'a", 'invoicing' ), | |
| 721 | + '22' => __( 'Kiambu', 'invoicing' ), | |
| 722 | + '23' => __( 'Turkana', 'invoicing' ), | |
| 723 | + '24' => __( 'West Pokot', 'invoicing' ), | |
| 724 | + '25' => __( 'Samburu', 'invoicing' ), | |
| 725 | + '26' => __( 'Trans-Nzoia', 'invoicing' ), | |
| 726 | + '27' => __( 'Uasin Gishu', 'invoicing' ), | |
| 727 | + '28' => __( 'Elgeyo-Marakwet', 'invoicing' ), | |
| 728 | + '29' => __( 'Nandi', 'invoicing' ), | |
| 729 | + '30' => __( 'Baringo', 'invoicing' ), | |
| 730 | + '31' => __( 'Laikipia', 'invoicing' ), | |
| 731 | + '32' => __( 'Nakuru', 'invoicing' ), | |
| 732 | + '33' => __( 'Narok', 'invoicing' ), | |
| 733 | + '34' => __( 'Kajiado', 'invoicing' ), | |
| 734 | + '35' => __( 'Kericho', 'invoicing' ), | |
| 735 | + '36' => __( 'Bomet', 'invoicing' ), | |
| 736 | + '37' => __( 'Kakamega', 'invoicing' ), | |
| 737 | + '38' => __( 'Vihiga', 'invoicing' ), | |
| 738 | + '39' => __( 'Bungoma', 'invoicing' ), | |
| 739 | + '40' => __( 'Busia', 'invoicing' ), | |
| 740 | + '41' => __( 'Siaya', 'invoicing' ), | |
| 741 | + '42' => __( 'Kisumu', 'invoicing' ), | |
| 742 | + '43' => __( 'Homa bay', 'invoicing' ), | |
| 743 | + '44' => __( 'Migori', 'invoicing' ), | |
| 744 | + '45' => __( 'Kisii', 'invoicing' ), | |
| 745 | + '46' => __( 'Nyamira', 'invoicing' ), | |
| 746 | + '47' => __( 'Nairobi', 'invoicing' ), | |
| 747 | + ), | |
| 748 | + 'KR' => array(), | |
| 749 | + 'KW' => array(), | |
| 750 | + 'LB' => array(), | |
| 751 | + 'LR' => array( // Liberia provinces. | |
| 752 | + 'BM' => __( 'Bomi', 'invoicing' ), | |
| 753 | + 'BN' => __( 'Bong', 'invoicing' ), | |
| 754 | + 'GA' => __( 'Gbarpolu', 'invoicing' ), | |
| 755 | + 'GB' => __( 'Grand Bassa', 'invoicing' ), | |
| 756 | + 'GC' => __( 'Grand Cape Mount', 'invoicing' ), | |
| 757 | + 'GG' => __( 'Grand Gedeh', 'invoicing' ), | |
| 758 | + 'GK' => __( 'Grand Kru', 'invoicing' ), | |
| 759 | + 'LO' => __( 'Lofa', 'invoicing' ), | |
| 760 | + 'MA' => __( 'Margibi', 'invoicing' ), | |
| 761 | + 'MY' => __( 'Maryland', 'invoicing' ), | |
| 762 | + 'MO' => __( 'Montserrado', 'invoicing' ), | |
| 763 | + 'NM' => __( 'Nimba', 'invoicing' ), | |
| 764 | + 'RV' => __( 'Rivercess', 'invoicing' ), | |
| 765 | + 'RG' => __( 'River Gee', 'invoicing' ), | |
| 766 | + 'SN' => __( 'Sinoe', 'invoicing' ), | |
| 767 | + ), | |
| 768 | + 'LU' => array(), | |
| 769 | + 'MD' => array( // Moldova states. | |
| 770 | + 'C' => __( 'Chișinău', 'invoicing' ), | |
| 771 | + 'BL' => __( 'Bălți', 'invoicing' ), | |
| 772 | + 'AN' => __( 'Anenii Noi', 'invoicing' ), | |
| 773 | + 'BS' => __( 'Basarabeasca', 'invoicing' ), | |
| 774 | + 'BR' => __( 'Briceni', 'invoicing' ), | |
| 775 | + 'CH' => __( 'Cahul', 'invoicing' ), | |
| 776 | + 'CT' => __( 'Cantemir', 'invoicing' ), | |
| 777 | + 'CL' => __( 'Călărași', 'invoicing' ), | |
| 778 | + 'CS' => __( 'Căușeni', 'invoicing' ), | |
| 779 | + 'CM' => __( 'Cimișlia', 'invoicing' ), | |
| 780 | + 'CR' => __( 'Criuleni', 'invoicing' ), | |
| 781 | + 'DN' => __( 'Dondușeni', 'invoicing' ), | |
| 782 | + 'DR' => __( 'Drochia', 'invoicing' ), | |
| 783 | + 'DB' => __( 'Dubăsari', 'invoicing' ), | |
| 784 | + 'ED' => __( 'Edineț', 'invoicing' ), | |
| 785 | + 'FL' => __( 'Fălești', 'invoicing' ), | |
| 786 | + 'FR' => __( 'Florești', 'invoicing' ), | |
| 787 | + 'GE' => __( 'UTA Găgăuzia', 'invoicing' ), | |
| 788 | + 'GL' => __( 'Glodeni', 'invoicing' ), | |
| 789 | + 'HN' => __( 'Hîncești', 'invoicing' ), | |
| 790 | + 'IL' => __( 'Ialoveni', 'invoicing' ), | |
| 791 | + 'LV' => __( 'Leova', 'invoicing' ), | |
| 792 | + 'NS' => __( 'Nisporeni', 'invoicing' ), | |
| 793 | + 'OC' => __( 'Ocnița', 'invoicing' ), | |
| 794 | + 'OR' => __( 'Orhei', 'invoicing' ), | |
| 795 | + 'RZ' => __( 'Rezina', 'invoicing' ), | |
| 796 | + 'RS' => __( 'Rîșcani', 'invoicing' ), | |
| 797 | + 'SG' => __( 'Sîngerei', 'invoicing' ), | |
| 798 | + 'SR' => __( 'Soroca', 'invoicing' ), | |
| 799 | + 'ST' => __( 'Strășeni', 'invoicing' ), | |
| 800 | + 'SD' => __( 'Șoldănești', 'invoicing' ), | |
| 801 | + 'SV' => __( 'Ștefan Vodă', 'invoicing' ), | |
| 802 | + 'TR' => __( 'Taraclia', 'invoicing' ), | |
| 803 | + 'TL' => __( 'Telenești', 'invoicing' ), | |
| 804 | + 'UN' => __( 'Ungheni', 'invoicing' ), | |
| 805 | + ), | |
| 806 | + 'MQ' => array(), | |
| 807 | + 'MT' => array(), | |
| 808 | + 'MX' => array( // Mexico States. | |
| 809 | + 'DF' => __( 'Ciudad de México', 'invoicing' ), | |
| 810 | + 'JA' => __( 'Jalisco', 'invoicing' ), | |
| 811 | + 'NL' => __( 'Nuevo León', 'invoicing' ), | |
| 812 | + 'AG' => __( 'Aguascalientes', 'invoicing' ), | |
| 813 | + 'BC' => __( 'Baja California', 'invoicing' ), | |
| 814 | + 'BS' => __( 'Baja California Sur', 'invoicing' ), | |
| 815 | + 'CM' => __( 'Campeche', 'invoicing' ), | |
| 816 | + 'CS' => __( 'Chiapas', 'invoicing' ), | |
| 817 | + 'CH' => __( 'Chihuahua', 'invoicing' ), | |
| 818 | + 'CO' => __( 'Coahuila', 'invoicing' ), | |
| 819 | + 'CL' => __( 'Colima', 'invoicing' ), | |
| 820 | + 'DG' => __( 'Durango', 'invoicing' ), | |
| 821 | + 'GT' => __( 'Guanajuato', 'invoicing' ), | |
| 822 | + 'GR' => __( 'Guerrero', 'invoicing' ), | |
| 823 | + 'HG' => __( 'Hidalgo', 'invoicing' ), | |
| 824 | + 'MX' => __( 'Estado de México', 'invoicing' ), | |
| 825 | + 'MI' => __( 'Michoacán', 'invoicing' ), | |
| 826 | + 'MO' => __( 'Morelos', 'invoicing' ), | |
| 827 | + 'NA' => __( 'Nayarit', 'invoicing' ), | |
| 828 | + 'OA' => __( 'Oaxaca', 'invoicing' ), | |
| 829 | + 'PU' => __( 'Puebla', 'invoicing' ), | |
| 830 | + 'QT' => __( 'Querétaro', 'invoicing' ), | |
| 831 | + 'QR' => __( 'Quintana Roo', 'invoicing' ), | |
| 832 | + 'SL' => __( 'San Luis Potosí', 'invoicing' ), | |
| 833 | + 'SI' => __( 'Sinaloa', 'invoicing' ), | |
| 834 | + 'SO' => __( 'Sonora', 'invoicing' ), | |
| 835 | + 'TB' => __( 'Tabasco', 'invoicing' ), | |
| 836 | + 'TM' => __( 'Tamaulipas', 'invoicing' ), | |
| 837 | + 'TL' => __( 'Tlaxcala', 'invoicing' ), | |
| 838 | + 'VE' => __( 'Veracruz', 'invoicing' ), | |
| 839 | + 'YU' => __( 'Yucatán', 'invoicing' ), | |
| 840 | + 'ZA' => __( 'Zacatecas', 'invoicing' ), | |
| 841 | + ), | |
| 842 | + 'MY' => array( // Malaysian states. | |
| 843 | + 'JHR' => __( 'Johor', 'invoicing' ), | |
| 844 | + 'KDH' => __( 'Kedah', 'invoicing' ), | |
| 845 | + 'KTN' => __( 'Kelantan', 'invoicing' ), | |
| 846 | + 'LBN' => __( 'Labuan', 'invoicing' ), | |
| 847 | + 'MLK' => __( 'Malacca (Melaka)', 'invoicing' ), | |
| 848 | + 'NSN' => __( 'Negeri Sembilan', 'invoicing' ), | |
| 849 | + 'PHG' => __( 'Pahang', 'invoicing' ), | |
| 850 | + 'PNG' => __( 'Penang (Pulau Pinang)', 'invoicing' ), | |
| 851 | + 'PRK' => __( 'Perak', 'invoicing' ), | |
| 852 | + 'PLS' => __( 'Perlis', 'invoicing' ), | |
| 853 | + 'SBH' => __( 'Sabah', 'invoicing' ), | |
| 854 | + 'SWK' => __( 'Sarawak', 'invoicing' ), | |
| 855 | + 'SGR' => __( 'Selangor', 'invoicing' ), | |
| 856 | + 'TRG' => __( 'Terengganu', 'invoicing' ), | |
| 857 | + 'PJY' => __( 'Putrajaya', 'invoicing' ), | |
| 858 | + 'KUL' => __( 'Kuala Lumpur', 'invoicing' ), | |
| 859 | + ), | |
| 860 | + 'NG' => array( // Nigerian provinces. | |
| 861 | + 'AB' => __( 'Abia', 'invoicing' ), | |
| 862 | + 'FC' => __( 'Abuja', 'invoicing' ), | |
| 863 | + 'AD' => __( 'Adamawa', 'invoicing' ), | |
| 864 | + 'AK' => __( 'Akwa Ibom', 'invoicing' ), | |
| 865 | + 'AN' => __( 'Anambra', 'invoicing' ), | |
| 866 | + 'BA' => __( 'Bauchi', 'invoicing' ), | |
| 867 | + 'BY' => __( 'Bayelsa', 'invoicing' ), | |
| 868 | + 'BE' => __( 'Benue', 'invoicing' ), | |
| 869 | + 'BO' => __( 'Borno', 'invoicing' ), | |
| 870 | + 'CR' => __( 'Cross River', 'invoicing' ), | |
| 871 | + 'DE' => __( 'Delta', 'invoicing' ), | |
| 872 | + 'EB' => __( 'Ebonyi', 'invoicing' ), | |
| 873 | + 'ED' => __( 'Edo', 'invoicing' ), | |
| 874 | + 'EK' => __( 'Ekiti', 'invoicing' ), | |
| 875 | + 'EN' => __( 'Enugu', 'invoicing' ), | |
| 876 | + 'GO' => __( 'Gombe', 'invoicing' ), | |
| 877 | + 'IM' => __( 'Imo', 'invoicing' ), | |
| 878 | + 'JI' => __( 'Jigawa', 'invoicing' ), | |
| 879 | + 'KD' => __( 'Kaduna', 'invoicing' ), | |
| 880 | + 'KN' => __( 'Kano', 'invoicing' ), | |
| 881 | + 'KT' => __( 'Katsina', 'invoicing' ), | |
| 882 | + 'KE' => __( 'Kebbi', 'invoicing' ), | |
| 883 | + 'KO' => __( 'Kogi', 'invoicing' ), | |
| 884 | + 'KW' => __( 'Kwara', 'invoicing' ), | |
| 885 | + 'LA' => __( 'Lagos', 'invoicing' ), | |
| 886 | + 'NA' => __( 'Nasarawa', 'invoicing' ), | |
| 887 | + 'NI' => __( 'Niger', 'invoicing' ), | |
| 888 | + 'OG' => __( 'Ogun', 'invoicing' ), | |
| 889 | + 'ON' => __( 'Ondo', 'invoicing' ), | |
| 890 | + 'OS' => __( 'Osun', 'invoicing' ), | |
| 891 | + 'OY' => __( 'Oyo', 'invoicing' ), | |
| 892 | + 'PL' => __( 'Plateau', 'invoicing' ), | |
| 893 | + 'RI' => __( 'Rivers', 'invoicing' ), | |
| 894 | + 'SO' => __( 'Sokoto', 'invoicing' ), | |
| 895 | + 'TA' => __( 'Taraba', 'invoicing' ), | |
| 896 | + 'YO' => __( 'Yobe', 'invoicing' ), | |
| 897 | + 'ZA' => __( 'Zamfara', 'invoicing' ), | |
| 898 | + ), | |
| 899 | + 'NL' => array(), | |
| 900 | + 'NO' => array(), | |
| 901 | + 'NP' => array( // Nepal states (Zones). | |
| 902 | + 'BAG' => __( 'Bagmati', 'invoicing' ), | |
| 903 | + 'BHE' => __( 'Bheri', 'invoicing' ), | |
| 904 | + 'DHA' => __( 'Dhaulagiri', 'invoicing' ), | |
| 905 | + 'GAN' => __( 'Gandaki', 'invoicing' ), | |
| 906 | + 'JAN' => __( 'Janakpur', 'invoicing' ), | |
| 907 | + 'KAR' => __( 'Karnali', 'invoicing' ), | |
| 908 | + 'KOS' => __( 'Koshi', 'invoicing' ), | |
| 909 | + 'LUM' => __( 'Lumbini', 'invoicing' ), | |
| 910 | + 'MAH' => __( 'Mahakali', 'invoicing' ), | |
| 911 | + 'MEC' => __( 'Mechi', 'invoicing' ), | |
| 912 | + 'NAR' => __( 'Narayani', 'invoicing' ), | |
| 913 | + 'RAP' => __( 'Rapti', 'invoicing' ), | |
| 914 | + 'SAG' => __( 'Sagarmatha', 'invoicing' ), | |
| 915 | + 'SET' => __( 'Seti', 'invoicing' ), | |
| 916 | + ), | |
| 917 | + 'NZ' => array( // New Zealand States. | |
| 918 | + 'NL' => __( 'Northland', 'invoicing' ), | |
| 919 | + 'AK' => __( 'Auckland', 'invoicing' ), | |
| 920 | + 'WA' => __( 'Waikato', 'invoicing' ), | |
| 921 | + 'BP' => __( 'Bay of Plenty', 'invoicing' ), | |
| 922 | + 'TK' => __( 'Taranaki', 'invoicing' ), | |
| 923 | + 'GI' => __( 'Gisborne', 'invoicing' ), | |
| 924 | + 'HB' => __( 'Hawke’s Bay', 'invoicing' ), | |
| 925 | + 'MW' => __( 'Manawatu-Wanganui', 'invoicing' ), | |
| 926 | + 'WE' => __( 'Wellington', 'invoicing' ), | |
| 927 | + 'NS' => __( 'Nelson', 'invoicing' ), | |
| 928 | + 'MB' => __( 'Marlborough', 'invoicing' ), | |
| 929 | + 'TM' => __( 'Tasman', 'invoicing' ), | |
| 930 | + 'WC' => __( 'West Coast', 'invoicing' ), | |
| 931 | + 'CT' => __( 'Canterbury', 'invoicing' ), | |
| 932 | + 'OT' => __( 'Otago', 'invoicing' ), | |
| 933 | + 'SL' => __( 'Southland', 'invoicing' ), | |
| 934 | + ), | |
| 935 | + 'PE' => array( // Peru states. | |
| 936 | + 'CAL' => __( 'El Callao', 'invoicing' ), | |
| 937 | + 'LMA' => __( 'Municipalidad Metropolitana de Lima', 'invoicing' ), | |
| 938 | + 'AMA' => __( 'Amazonas', 'invoicing' ), | |
| 939 | + 'ANC' => __( 'Ancash', 'invoicing' ), | |
| 940 | + 'APU' => __( 'Apurímac', 'invoicing' ), | |
| 941 | + 'ARE' => __( 'Arequipa', 'invoicing' ), | |
| 942 | + 'AYA' => __( 'Ayacucho', 'invoicing' ), | |
| 943 | + 'CAJ' => __( 'Cajamarca', 'invoicing' ), | |
| 944 | + 'CUS' => __( 'Cusco', 'invoicing' ), | |
| 945 | + 'HUV' => __( 'Huancavelica', 'invoicing' ), | |
| 946 | + 'HUC' => __( 'Huánuco', 'invoicing' ), | |
| 947 | + 'ICA' => __( 'Ica', 'invoicing' ), | |
| 948 | + 'JUN' => __( 'Junín', 'invoicing' ), | |
| 949 | + 'LAL' => __( 'La Libertad', 'invoicing' ), | |
| 950 | + 'LAM' => __( 'Lambayeque', 'invoicing' ), | |
| 951 | + 'LIM' => __( 'Lima', 'invoicing' ), | |
| 952 | + 'LOR' => __( 'Loreto', 'invoicing' ), | |
| 953 | + 'MDD' => __( 'Madre de Dios', 'invoicing' ), | |
| 954 | + 'MOQ' => __( 'Moquegua', 'invoicing' ), | |
| 955 | + 'PAS' => __( 'Pasco', 'invoicing' ), | |
| 956 | + 'PIU' => __( 'Piura', 'invoicing' ), | |
| 957 | + 'PUN' => __( 'Puno', 'invoicing' ), | |
| 958 | + 'SAM' => __( 'San Martín', 'invoicing' ), | |
| 959 | + 'TAC' => __( 'Tacna', 'invoicing' ), | |
| 960 | + 'TUM' => __( 'Tumbes', 'invoicing' ), | |
| 961 | + 'UCA' => __( 'Ucayali', 'invoicing' ), | |
| 962 | + ), | |
| 963 | 963 | |
| 964 | - /** | |
| 965 | - * Philippine Provinces. | |
| 966 | - */ | |
| 967 | - 'PH' => array( | |
| 968 | - 'ABR' => __( 'Abra', 'invoicing' ), | |
| 969 | - 'AGN' => __( 'Agusan del Norte', 'invoicing' ), | |
| 970 | - 'AGS' => __( 'Agusan del Sur', 'invoicing' ), | |
| 971 | - 'AKL' => __( 'Aklan', 'invoicing' ), | |
| 972 | - 'ALB' => __( 'Albay', 'invoicing' ), | |
| 973 | - 'ANT' => __( 'Antique', 'invoicing' ), | |
| 974 | - 'APA' => __( 'Apayao', 'invoicing' ), | |
| 975 | - 'AUR' => __( 'Aurora', 'invoicing' ), | |
| 976 | - 'BAS' => __( 'Basilan', 'invoicing' ), | |
| 977 | - 'BAN' => __( 'Bataan', 'invoicing' ), | |
| 978 | - 'BTN' => __( 'Batanes', 'invoicing' ), | |
| 979 | - 'BTG' => __( 'Batangas', 'invoicing' ), | |
| 980 | - 'BEN' => __( 'Benguet', 'invoicing' ), | |
| 981 | - 'BIL' => __( 'Biliran', 'invoicing' ), | |
| 982 | - 'BOH' => __( 'Bohol', 'invoicing' ), | |
| 983 | - 'BUK' => __( 'Bukidnon', 'invoicing' ), | |
| 984 | - 'BUL' => __( 'Bulacan', 'invoicing' ), | |
| 985 | - 'CAG' => __( 'Cagayan', 'invoicing' ), | |
| 986 | - 'CAN' => __( 'Camarines Norte', 'invoicing' ), | |
| 987 | - 'CAS' => __( 'Camarines Sur', 'invoicing' ), | |
| 988 | - 'CAM' => __( 'Camiguin', 'invoicing' ), | |
| 989 | - 'CAP' => __( 'Capiz', 'invoicing' ), | |
| 990 | - 'CAT' => __( 'Catanduanes', 'invoicing' ), | |
| 991 | - 'CAV' => __( 'Cavite', 'invoicing' ), | |
| 992 | - 'CEB' => __( 'Cebu', 'invoicing' ), | |
| 993 | - 'COM' => __( 'Compostela Valley', 'invoicing' ), | |
| 994 | - 'NCO' => __( 'Cotabato', 'invoicing' ), | |
| 995 | - 'DAV' => __( 'Davao del Norte', 'invoicing' ), | |
| 996 | - 'DAS' => __( 'Davao del Sur', 'invoicing' ), | |
| 997 | - 'DAC' => __( 'Davao Occidental', 'invoicing' ), | |
| 998 | - 'DAO' => __( 'Davao Oriental', 'invoicing' ), | |
| 999 | - 'DIN' => __( 'Dinagat Islands', 'invoicing' ), | |
| 1000 | - 'EAS' => __( 'Eastern Samar', 'invoicing' ), | |
| 1001 | - 'GUI' => __( 'Guimaras', 'invoicing' ), | |
| 1002 | - 'IFU' => __( 'Ifugao', 'invoicing' ), | |
| 1003 | - 'ILN' => __( 'Ilocos Norte', 'invoicing' ), | |
| 1004 | - 'ILS' => __( 'Ilocos Sur', 'invoicing' ), | |
| 1005 | - 'ILI' => __( 'Iloilo', 'invoicing' ), | |
| 1006 | - 'ISA' => __( 'Isabela', 'invoicing' ), | |
| 1007 | - 'KAL' => __( 'Kalinga', 'invoicing' ), | |
| 1008 | - 'LUN' => __( 'La Union', 'invoicing' ), | |
| 1009 | - 'LAG' => __( 'Laguna', 'invoicing' ), | |
| 1010 | - 'LAN' => __( 'Lanao del Norte', 'invoicing' ), | |
| 1011 | - 'LAS' => __( 'Lanao del Sur', 'invoicing' ), | |
| 1012 | - 'LEY' => __( 'Leyte', 'invoicing' ), | |
| 1013 | - 'MAG' => __( 'Maguindanao', 'invoicing' ), | |
| 1014 | - 'MAD' => __( 'Marinduque', 'invoicing' ), | |
| 1015 | - 'MAS' => __( 'Masbate', 'invoicing' ), | |
| 1016 | - 'MSC' => __( 'Misamis Occidental', 'invoicing' ), | |
| 1017 | - 'MSR' => __( 'Misamis Oriental', 'invoicing' ), | |
| 1018 | - 'MOU' => __( 'Mountain Province', 'invoicing' ), | |
| 1019 | - 'NEC' => __( 'Negros Occidental', 'invoicing' ), | |
| 1020 | - 'NER' => __( 'Negros Oriental', 'invoicing' ), | |
| 1021 | - 'NSA' => __( 'Northern Samar', 'invoicing' ), | |
| 1022 | - 'NUE' => __( 'Nueva Ecija', 'invoicing' ), | |
| 1023 | - 'NUV' => __( 'Nueva Vizcaya', 'invoicing' ), | |
| 1024 | - 'MDC' => __( 'Occidental Mindoro', 'invoicing' ), | |
| 1025 | - 'MDR' => __( 'Oriental Mindoro', 'invoicing' ), | |
| 1026 | - 'PLW' => __( 'Palawan', 'invoicing' ), | |
| 1027 | - 'PAM' => __( 'Pampanga', 'invoicing' ), | |
| 1028 | - 'PAN' => __( 'Pangasinan', 'invoicing' ), | |
| 1029 | - 'QUE' => __( 'Quezon', 'invoicing' ), | |
| 1030 | - 'QUI' => __( 'Quirino', 'invoicing' ), | |
| 1031 | - 'RIZ' => __( 'Rizal', 'invoicing' ), | |
| 1032 | - 'ROM' => __( 'Romblon', 'invoicing' ), | |
| 1033 | - 'WSA' => __( 'Samar', 'invoicing' ), | |
| 1034 | - 'SAR' => __( 'Sarangani', 'invoicing' ), | |
| 1035 | - 'SIQ' => __( 'Siquijor', 'invoicing' ), | |
| 1036 | - 'SOR' => __( 'Sorsogon', 'invoicing' ), | |
| 1037 | - 'SCO' => __( 'South Cotabato', 'invoicing' ), | |
| 1038 | - 'SLE' => __( 'Southern Leyte', 'invoicing' ), | |
| 1039 | - 'SUK' => __( 'Sultan Kudarat', 'invoicing' ), | |
| 1040 | - 'SLU' => __( 'Sulu', 'invoicing' ), | |
| 1041 | - 'SUN' => __( 'Surigao del Norte', 'invoicing' ), | |
| 1042 | - 'SUR' => __( 'Surigao del Sur', 'invoicing' ), | |
| 1043 | - 'TAR' => __( 'Tarlac', 'invoicing' ), | |
| 1044 | - 'TAW' => __( 'Tawi-Tawi', 'invoicing' ), | |
| 1045 | - 'ZMB' => __( 'Zambales', 'invoicing' ), | |
| 1046 | - 'ZAN' => __( 'Zamboanga del Norte', 'invoicing' ), | |
| 1047 | - 'ZAS' => __( 'Zamboanga del Sur', 'invoicing' ), | |
| 1048 | - 'ZSI' => __( 'Zamboanga Sibugay', 'invoicing' ), | |
| 1049 | - '00' => __( 'Metro Manila', 'invoicing' ), | |
| 1050 | - ), | |
| 1051 | - 'PK' => array( // Pakistan's states. | |
| 1052 | - 'JK' => __( 'Azad Kashmir', 'invoicing' ), | |
| 1053 | - 'BA' => __( 'Balochistan', 'invoicing' ), | |
| 1054 | - 'TA' => __( 'FATA', 'invoicing' ), | |
| 1055 | - 'GB' => __( 'Gilgit Baltistan', 'invoicing' ), | |
| 1056 | - 'IS' => __( 'Islamabad Capital Territory', 'invoicing' ), | |
| 1057 | - 'KP' => __( 'Khyber Pakhtunkhwa', 'invoicing' ), | |
| 1058 | - 'PB' => __( 'Punjab', 'invoicing' ), | |
| 1059 | - 'SD' => __( 'Sindh', 'invoicing' ), | |
| 1060 | - ), | |
| 1061 | - 'PL' => array(), | |
| 1062 | - 'PT' => array(), | |
| 1063 | - 'PY' => array( // Paraguay states. | |
| 1064 | - 'PY-ASU' => __( 'Asunción', 'invoicing' ), | |
| 1065 | - 'PY-1' => __( 'Concepción', 'invoicing' ), | |
| 1066 | - 'PY-2' => __( 'San Pedro', 'invoicing' ), | |
| 1067 | - 'PY-3' => __( 'Cordillera', 'invoicing' ), | |
| 1068 | - 'PY-4' => __( 'Guairá', 'invoicing' ), | |
| 1069 | - 'PY-5' => __( 'Caaguazú', 'invoicing' ), | |
| 1070 | - 'PY-6' => __( 'Caazapá', 'invoicing' ), | |
| 1071 | - 'PY-7' => __( 'Itapúa', 'invoicing' ), | |
| 1072 | - 'PY-8' => __( 'Misiones', 'invoicing' ), | |
| 1073 | - 'PY-9' => __( 'Paraguarí', 'invoicing' ), | |
| 1074 | - 'PY-10' => __( 'Alto Paraná', 'invoicing' ), | |
| 1075 | - 'PY-11' => __( 'Central', 'invoicing' ), | |
| 1076 | - 'PY-12' => __( 'Ñeembucú', 'invoicing' ), | |
| 1077 | - 'PY-13' => __( 'Amambay', 'invoicing' ), | |
| 1078 | - 'PY-14' => __( 'Canindeyú', 'invoicing' ), | |
| 1079 | - 'PY-15' => __( 'Presidente Hayes', 'invoicing' ), | |
| 1080 | - 'PY-16' => __( 'Alto Paraguay', 'invoicing' ), | |
| 1081 | - 'PY-17' => __( 'Boquerón', 'invoicing' ), | |
| 1082 | - ), | |
| 1083 | - 'RE' => array(), | |
| 1084 | - 'RO' => array( // Romania states. | |
| 1085 | - 'AB' => __( 'Alba', 'invoicing' ), | |
| 1086 | - 'AR' => __( 'Arad', 'invoicing' ), | |
| 1087 | - 'AG' => __( 'Argeș', 'invoicing' ), | |
| 1088 | - 'BC' => __( 'Bacău', 'invoicing' ), | |
| 1089 | - 'BH' => __( 'Bihor', 'invoicing' ), | |
| 1090 | - 'BN' => __( 'Bistrița-Năsăud', 'invoicing' ), | |
| 1091 | - 'BT' => __( 'Botoșani', 'invoicing' ), | |
| 1092 | - 'BR' => __( 'Brăila', 'invoicing' ), | |
| 1093 | - 'BV' => __( 'Brașov', 'invoicing' ), | |
| 1094 | - 'B' => __( 'București', 'invoicing' ), | |
| 1095 | - 'BZ' => __( 'Buzău', 'invoicing' ), | |
| 1096 | - 'CL' => __( 'Călărași', 'invoicing' ), | |
| 1097 | - 'CS' => __( 'Caraș-Severin', 'invoicing' ), | |
| 1098 | - 'CJ' => __( 'Cluj', 'invoicing' ), | |
| 1099 | - 'CT' => __( 'Constanța', 'invoicing' ), | |
| 1100 | - 'CV' => __( 'Covasna', 'invoicing' ), | |
| 1101 | - 'DB' => __( 'Dâmbovița', 'invoicing' ), | |
| 1102 | - 'DJ' => __( 'Dolj', 'invoicing' ), | |
| 1103 | - 'GL' => __( 'Galați', 'invoicing' ), | |
| 1104 | - 'GR' => __( 'Giurgiu', 'invoicing' ), | |
| 1105 | - 'GJ' => __( 'Gorj', 'invoicing' ), | |
| 1106 | - 'HR' => __( 'Harghita', 'invoicing' ), | |
| 1107 | - 'HD' => __( 'Hunedoara', 'invoicing' ), | |
| 1108 | - 'IL' => __( 'Ialomița', 'invoicing' ), | |
| 1109 | - 'IS' => __( 'Iași', 'invoicing' ), | |
| 1110 | - 'IF' => __( 'Ilfov', 'invoicing' ), | |
| 1111 | - 'MM' => __( 'Maramureș', 'invoicing' ), | |
| 1112 | - 'MH' => __( 'Mehedinți', 'invoicing' ), | |
| 1113 | - 'MS' => __( 'Mureș', 'invoicing' ), | |
| 1114 | - 'NT' => __( 'Neamț', 'invoicing' ), | |
| 1115 | - 'OT' => __( 'Olt', 'invoicing' ), | |
| 1116 | - 'PH' => __( 'Prahova', 'invoicing' ), | |
| 1117 | - 'SJ' => __( 'Sălaj', 'invoicing' ), | |
| 1118 | - 'SM' => __( 'Satu Mare', 'invoicing' ), | |
| 1119 | - 'SB' => __( 'Sibiu', 'invoicing' ), | |
| 1120 | - 'SV' => __( 'Suceava', 'invoicing' ), | |
| 1121 | - 'TR' => __( 'Teleorman', 'invoicing' ), | |
| 1122 | - 'TM' => __( 'Timiș', 'invoicing' ), | |
| 1123 | - 'TL' => __( 'Tulcea', 'invoicing' ), | |
| 1124 | - 'VL' => __( 'Vâlcea', 'invoicing' ), | |
| 1125 | - 'VS' => __( 'Vaslui', 'invoicing' ), | |
| 1126 | - 'VN' => __( 'Vrancea', 'invoicing' ), | |
| 1127 | - ), | |
| 1128 | - 'RS' => array(), | |
| 1129 | - 'SG' => array(), | |
| 1130 | - 'SK' => array(), | |
| 1131 | - 'SI' => array(), | |
| 1132 | - 'TH' => array( // Thailand states. | |
| 1133 | - 'TH-37' => __( 'Amnat Charoen', 'invoicing' ), | |
| 1134 | - 'TH-15' => __( 'Ang Thong', 'invoicing' ), | |
| 1135 | - 'TH-14' => __( 'Ayutthaya', 'invoicing' ), | |
| 1136 | - 'TH-10' => __( 'Bangkok', 'invoicing' ), | |
| 1137 | - 'TH-38' => __( 'Bueng Kan', 'invoicing' ), | |
| 1138 | - 'TH-31' => __( 'Buri Ram', 'invoicing' ), | |
| 1139 | - 'TH-24' => __( 'Chachoengsao', 'invoicing' ), | |
| 1140 | - 'TH-18' => __( 'Chai Nat', 'invoicing' ), | |
| 1141 | - 'TH-36' => __( 'Chaiyaphum', 'invoicing' ), | |
| 1142 | - 'TH-22' => __( 'Chanthaburi', 'invoicing' ), | |
| 1143 | - 'TH-50' => __( 'Chiang Mai', 'invoicing' ), | |
| 1144 | - 'TH-57' => __( 'Chiang Rai', 'invoicing' ), | |
| 1145 | - 'TH-20' => __( 'Chonburi', 'invoicing' ), | |
| 1146 | - 'TH-86' => __( 'Chumphon', 'invoicing' ), | |
| 1147 | - 'TH-46' => __( 'Kalasin', 'invoicing' ), | |
| 1148 | - 'TH-62' => __( 'Kamphaeng Phet', 'invoicing' ), | |
| 1149 | - 'TH-71' => __( 'Kanchanaburi', 'invoicing' ), | |
| 1150 | - 'TH-40' => __( 'Khon Kaen', 'invoicing' ), | |
| 1151 | - 'TH-81' => __( 'Krabi', 'invoicing' ), | |
| 1152 | - 'TH-52' => __( 'Lampang', 'invoicing' ), | |
| 1153 | - 'TH-51' => __( 'Lamphun', 'invoicing' ), | |
| 1154 | - 'TH-42' => __( 'Loei', 'invoicing' ), | |
| 1155 | - 'TH-16' => __( 'Lopburi', 'invoicing' ), | |
| 1156 | - 'TH-58' => __( 'Mae Hong Son', 'invoicing' ), | |
| 1157 | - 'TH-44' => __( 'Maha Sarakham', 'invoicing' ), | |
| 1158 | - 'TH-49' => __( 'Mukdahan', 'invoicing' ), | |
| 1159 | - 'TH-26' => __( 'Nakhon Nayok', 'invoicing' ), | |
| 1160 | - 'TH-73' => __( 'Nakhon Pathom', 'invoicing' ), | |
| 1161 | - 'TH-48' => __( 'Nakhon Phanom', 'invoicing' ), | |
| 1162 | - 'TH-30' => __( 'Nakhon Ratchasima', 'invoicing' ), | |
| 1163 | - 'TH-60' => __( 'Nakhon Sawan', 'invoicing' ), | |
| 1164 | - 'TH-80' => __( 'Nakhon Si Thammarat', 'invoicing' ), | |
| 1165 | - 'TH-55' => __( 'Nan', 'invoicing' ), | |
| 1166 | - 'TH-96' => __( 'Narathiwat', 'invoicing' ), | |
| 1167 | - 'TH-39' => __( 'Nong Bua Lam Phu', 'invoicing' ), | |
| 1168 | - 'TH-43' => __( 'Nong Khai', 'invoicing' ), | |
| 1169 | - 'TH-12' => __( 'Nonthaburi', 'invoicing' ), | |
| 1170 | - 'TH-13' => __( 'Pathum Thani', 'invoicing' ), | |
| 1171 | - 'TH-94' => __( 'Pattani', 'invoicing' ), | |
| 1172 | - 'TH-82' => __( 'Phang Nga', 'invoicing' ), | |
| 1173 | - 'TH-93' => __( 'Phatthalung', 'invoicing' ), | |
| 1174 | - 'TH-56' => __( 'Phayao', 'invoicing' ), | |
| 1175 | - 'TH-67' => __( 'Phetchabun', 'invoicing' ), | |
| 1176 | - 'TH-76' => __( 'Phetchaburi', 'invoicing' ), | |
| 1177 | - 'TH-66' => __( 'Phichit', 'invoicing' ), | |
| 1178 | - 'TH-65' => __( 'Phitsanulok', 'invoicing' ), | |
| 1179 | - 'TH-54' => __( 'Phrae', 'invoicing' ), | |
| 1180 | - 'TH-83' => __( 'Phuket', 'invoicing' ), | |
| 1181 | - 'TH-25' => __( 'Prachin Buri', 'invoicing' ), | |
| 1182 | - 'TH-77' => __( 'Prachuap Khiri Khan', 'invoicing' ), | |
| 1183 | - 'TH-85' => __( 'Ranong', 'invoicing' ), | |
| 1184 | - 'TH-70' => __( 'Ratchaburi', 'invoicing' ), | |
| 1185 | - 'TH-21' => __( 'Rayong', 'invoicing' ), | |
| 1186 | - 'TH-45' => __( 'Roi Et', 'invoicing' ), | |
| 1187 | - 'TH-27' => __( 'Sa Kaeo', 'invoicing' ), | |
| 1188 | - 'TH-47' => __( 'Sakon Nakhon', 'invoicing' ), | |
| 1189 | - 'TH-11' => __( 'Samut Prakan', 'invoicing' ), | |
| 1190 | - 'TH-74' => __( 'Samut Sakhon', 'invoicing' ), | |
| 1191 | - 'TH-75' => __( 'Samut Songkhram', 'invoicing' ), | |
| 1192 | - 'TH-19' => __( 'Saraburi', 'invoicing' ), | |
| 1193 | - 'TH-91' => __( 'Satun', 'invoicing' ), | |
| 1194 | - 'TH-17' => __( 'Sing Buri', 'invoicing' ), | |
| 1195 | - 'TH-33' => __( 'Sisaket', 'invoicing' ), | |
| 1196 | - 'TH-90' => __( 'Songkhla', 'invoicing' ), | |
| 1197 | - 'TH-64' => __( 'Sukhothai', 'invoicing' ), | |
| 1198 | - 'TH-72' => __( 'Suphan Buri', 'invoicing' ), | |
| 1199 | - 'TH-84' => __( 'Surat Thani', 'invoicing' ), | |
| 1200 | - 'TH-32' => __( 'Surin', 'invoicing' ), | |
| 1201 | - 'TH-63' => __( 'Tak', 'invoicing' ), | |
| 1202 | - 'TH-92' => __( 'Trang', 'invoicing' ), | |
| 1203 | - 'TH-23' => __( 'Trat', 'invoicing' ), | |
| 1204 | - 'TH-34' => __( 'Ubon Ratchathani', 'invoicing' ), | |
| 1205 | - 'TH-41' => __( 'Udon Thani', 'invoicing' ), | |
| 1206 | - 'TH-61' => __( 'Uthai Thani', 'invoicing' ), | |
| 1207 | - 'TH-53' => __( 'Uttaradit', 'invoicing' ), | |
| 1208 | - 'TH-95' => __( 'Yala', 'invoicing' ), | |
| 1209 | - 'TH-35' => __( 'Yasothon', 'invoicing' ), | |
| 1210 | - ), | |
| 1211 | - 'TR' => array( // Turkey States. | |
| 1212 | - 'TR01' => __( 'Adana', 'invoicing' ), | |
| 1213 | - 'TR02' => __( 'Adıyaman', 'invoicing' ), | |
| 1214 | - 'TR03' => __( 'Afyon', 'invoicing' ), | |
| 1215 | - 'TR04' => __( 'Ağrı', 'invoicing' ), | |
| 1216 | - 'TR05' => __( 'Amasya', 'invoicing' ), | |
| 1217 | - 'TR06' => __( 'Ankara', 'invoicing' ), | |
| 1218 | - 'TR07' => __( 'Antalya', 'invoicing' ), | |
| 1219 | - 'TR08' => __( 'Artvin', 'invoicing' ), | |
| 1220 | - 'TR09' => __( 'Aydın', 'invoicing' ), | |
| 1221 | - 'TR10' => __( 'Balıkesir', 'invoicing' ), | |
| 1222 | - 'TR11' => __( 'Bilecik', 'invoicing' ), | |
| 1223 | - 'TR12' => __( 'Bingöl', 'invoicing' ), | |
| 1224 | - 'TR13' => __( 'Bitlis', 'invoicing' ), | |
| 1225 | - 'TR14' => __( 'Bolu', 'invoicing' ), | |
| 1226 | - 'TR15' => __( 'Burdur', 'invoicing' ), | |
| 1227 | - 'TR16' => __( 'Bursa', 'invoicing' ), | |
| 1228 | - 'TR17' => __( 'Çanakkale', 'invoicing' ), | |
| 1229 | - 'TR18' => __( 'Çankırı', 'invoicing' ), | |
| 1230 | - 'TR19' => __( 'Çorum', 'invoicing' ), | |
| 1231 | - 'TR20' => __( 'Denizli', 'invoicing' ), | |
| 1232 | - 'TR21' => __( 'Diyarbakır', 'invoicing' ), | |
| 1233 | - 'TR22' => __( 'Edirne', 'invoicing' ), | |
| 1234 | - 'TR23' => __( 'Elazığ', 'invoicing' ), | |
| 1235 | - 'TR24' => __( 'Erzincan', 'invoicing' ), | |
| 1236 | - 'TR25' => __( 'Erzurum', 'invoicing' ), | |
| 1237 | - 'TR26' => __( 'Eskişehir', 'invoicing' ), | |
| 1238 | - 'TR27' => __( 'Gaziantep', 'invoicing' ), | |
| 1239 | - 'TR28' => __( 'Giresun', 'invoicing' ), | |
| 1240 | - 'TR29' => __( 'Gümüşhane', 'invoicing' ), | |
| 1241 | - 'TR30' => __( 'Hakkari', 'invoicing' ), | |
| 1242 | - 'TR31' => __( 'Hatay', 'invoicing' ), | |
| 1243 | - 'TR32' => __( 'Isparta', 'invoicing' ), | |
| 1244 | - 'TR33' => __( 'İçel', 'invoicing' ), | |
| 1245 | - 'TR34' => __( 'İstanbul', 'invoicing' ), | |
| 1246 | - 'TR35' => __( 'İzmir', 'invoicing' ), | |
| 1247 | - 'TR36' => __( 'Kars', 'invoicing' ), | |
| 1248 | - 'TR37' => __( 'Kastamonu', 'invoicing' ), | |
| 1249 | - 'TR38' => __( 'Kayseri', 'invoicing' ), | |
| 1250 | - 'TR39' => __( 'Kırklareli', 'invoicing' ), | |
| 1251 | - 'TR40' => __( 'Kırşehir', 'invoicing' ), | |
| 1252 | - 'TR41' => __( 'Kocaeli', 'invoicing' ), | |
| 1253 | - 'TR42' => __( 'Konya', 'invoicing' ), | |
| 1254 | - 'TR43' => __( 'Kütahya', 'invoicing' ), | |
| 1255 | - 'TR44' => __( 'Malatya', 'invoicing' ), | |
| 1256 | - 'TR45' => __( 'Manisa', 'invoicing' ), | |
| 1257 | - 'TR46' => __( 'Kahramanmaraş', 'invoicing' ), | |
| 1258 | - 'TR47' => __( 'Mardin', 'invoicing' ), | |
| 1259 | - 'TR48' => __( 'Muğla', 'invoicing' ), | |
| 1260 | - 'TR49' => __( 'Muş', 'invoicing' ), | |
| 1261 | - 'TR50' => __( 'Nevşehir', 'invoicing' ), | |
| 1262 | - 'TR51' => __( 'Niğde', 'invoicing' ), | |
| 1263 | - 'TR52' => __( 'Ordu', 'invoicing' ), | |
| 1264 | - 'TR53' => __( 'Rize', 'invoicing' ), | |
| 1265 | - 'TR54' => __( 'Sakarya', 'invoicing' ), | |
| 1266 | - 'TR55' => __( 'Samsun', 'invoicing' ), | |
| 1267 | - 'TR56' => __( 'Siirt', 'invoicing' ), | |
| 1268 | - 'TR57' => __( 'Sinop', 'invoicing' ), | |
| 1269 | - 'TR58' => __( 'Sivas', 'invoicing' ), | |
| 1270 | - 'TR59' => __( 'Tekirdağ', 'invoicing' ), | |
| 1271 | - 'TR60' => __( 'Tokat', 'invoicing' ), | |
| 1272 | - 'TR61' => __( 'Trabzon', 'invoicing' ), | |
| 1273 | - 'TR62' => __( 'Tunceli', 'invoicing' ), | |
| 1274 | - 'TR63' => __( 'Şanlıurfa', 'invoicing' ), | |
| 1275 | - 'TR64' => __( 'Uşak', 'invoicing' ), | |
| 1276 | - 'TR65' => __( 'Van', 'invoicing' ), | |
| 1277 | - 'TR66' => __( 'Yozgat', 'invoicing' ), | |
| 1278 | - 'TR67' => __( 'Zonguldak', 'invoicing' ), | |
| 1279 | - 'TR68' => __( 'Aksaray', 'invoicing' ), | |
| 1280 | - 'TR69' => __( 'Bayburt', 'invoicing' ), | |
| 1281 | - 'TR70' => __( 'Karaman', 'invoicing' ), | |
| 1282 | - 'TR71' => __( 'Kırıkkale', 'invoicing' ), | |
| 1283 | - 'TR72' => __( 'Batman', 'invoicing' ), | |
| 1284 | - 'TR73' => __( 'Şırnak', 'invoicing' ), | |
| 1285 | - 'TR74' => __( 'Bartın', 'invoicing' ), | |
| 1286 | - 'TR75' => __( 'Ardahan', 'invoicing' ), | |
| 1287 | - 'TR76' => __( 'Iğdır', 'invoicing' ), | |
| 1288 | - 'TR77' => __( 'Yalova', 'invoicing' ), | |
| 1289 | - 'TR78' => __( 'Karabük', 'invoicing' ), | |
| 1290 | - 'TR79' => __( 'Kilis', 'invoicing' ), | |
| 1291 | - 'TR80' => __( 'Osmaniye', 'invoicing' ), | |
| 1292 | - 'TR81' => __( 'Düzce', 'invoicing' ), | |
| 1293 | - ), | |
| 1294 | - 'TZ' => array( // Tanzania States. | |
| 1295 | - 'TZ01' => __( 'Arusha', 'invoicing' ), | |
| 1296 | - 'TZ02' => __( 'Dar es Salaam', 'invoicing' ), | |
| 1297 | - 'TZ03' => __( 'Dodoma', 'invoicing' ), | |
| 1298 | - 'TZ04' => __( 'Iringa', 'invoicing' ), | |
| 1299 | - 'TZ05' => __( 'Kagera', 'invoicing' ), | |
| 1300 | - 'TZ06' => __( 'Pemba North', 'invoicing' ), | |
| 1301 | - 'TZ07' => __( 'Zanzibar North', 'invoicing' ), | |
| 1302 | - 'TZ08' => __( 'Kigoma', 'invoicing' ), | |
| 1303 | - 'TZ09' => __( 'Kilimanjaro', 'invoicing' ), | |
| 1304 | - 'TZ10' => __( 'Pemba South', 'invoicing' ), | |
| 1305 | - 'TZ11' => __( 'Zanzibar South', 'invoicing' ), | |
| 1306 | - 'TZ12' => __( 'Lindi', 'invoicing' ), | |
| 1307 | - 'TZ13' => __( 'Mara', 'invoicing' ), | |
| 1308 | - 'TZ14' => __( 'Mbeya', 'invoicing' ), | |
| 1309 | - 'TZ15' => __( 'Zanzibar West', 'invoicing' ), | |
| 1310 | - 'TZ16' => __( 'Morogoro', 'invoicing' ), | |
| 1311 | - 'TZ17' => __( 'Mtwara', 'invoicing' ), | |
| 1312 | - 'TZ18' => __( 'Mwanza', 'invoicing' ), | |
| 1313 | - 'TZ19' => __( 'Coast', 'invoicing' ), | |
| 1314 | - 'TZ20' => __( 'Rukwa', 'invoicing' ), | |
| 1315 | - 'TZ21' => __( 'Ruvuma', 'invoicing' ), | |
| 1316 | - 'TZ22' => __( 'Shinyanga', 'invoicing' ), | |
| 1317 | - 'TZ23' => __( 'Singida', 'invoicing' ), | |
| 1318 | - 'TZ24' => __( 'Tabora', 'invoicing' ), | |
| 1319 | - 'TZ25' => __( 'Tanga', 'invoicing' ), | |
| 1320 | - 'TZ26' => __( 'Manyara', 'invoicing' ), | |
| 1321 | - 'TZ27' => __( 'Geita', 'invoicing' ), | |
| 1322 | - 'TZ28' => __( 'Katavi', 'invoicing' ), | |
| 1323 | - 'TZ29' => __( 'Njombe', 'invoicing' ), | |
| 1324 | - 'TZ30' => __( 'Simiyu', 'invoicing' ), | |
| 1325 | - ), | |
| 1326 | - 'LK' => array(), | |
| 1327 | - 'SE' => array(), | |
| 1328 | - 'UG' => array( // Uganda districts. Ref: https://en.wikipedia.org/wiki/ISO_3166-2:UG. | |
| 1329 | - 'UG314' => __( 'Abim', 'invoicing' ), | |
| 1330 | - 'UG301' => __( 'Adjumani', 'invoicing' ), | |
| 1331 | - 'UG322' => __( 'Agago', 'invoicing' ), | |
| 1332 | - 'UG323' => __( 'Alebtong', 'invoicing' ), | |
| 1333 | - 'UG315' => __( 'Amolatar', 'invoicing' ), | |
| 1334 | - 'UG324' => __( 'Amudat', 'invoicing' ), | |
| 1335 | - 'UG216' => __( 'Amuria', 'invoicing' ), | |
| 1336 | - 'UG316' => __( 'Amuru', 'invoicing' ), | |
| 1337 | - 'UG302' => __( 'Apac', 'invoicing' ), | |
| 1338 | - 'UG303' => __( 'Arua', 'invoicing' ), | |
| 1339 | - 'UG217' => __( 'Budaka', 'invoicing' ), | |
| 1340 | - 'UG218' => __( 'Bududa', 'invoicing' ), | |
| 1341 | - 'UG201' => __( 'Bugiri', 'invoicing' ), | |
| 1342 | - 'UG235' => __( 'Bugweri', 'invoicing' ), | |
| 1343 | - 'UG420' => __( 'Buhweju', 'invoicing' ), | |
| 1344 | - 'UG117' => __( 'Buikwe', 'invoicing' ), | |
| 1345 | - 'UG219' => __( 'Bukedea', 'invoicing' ), | |
| 1346 | - 'UG118' => __( 'Bukomansimbi', 'invoicing' ), | |
| 1347 | - 'UG220' => __( 'Bukwa', 'invoicing' ), | |
| 1348 | - 'UG225' => __( 'Bulambuli', 'invoicing' ), | |
| 1349 | - 'UG416' => __( 'Buliisa', 'invoicing' ), | |
| 1350 | - 'UG401' => __( 'Bundibugyo', 'invoicing' ), | |
| 1351 | - 'UG430' => __( 'Bunyangabu', 'invoicing' ), | |
| 1352 | - 'UG402' => __( 'Bushenyi', 'invoicing' ), | |
| 1353 | - 'UG202' => __( 'Busia', 'invoicing' ), | |
| 1354 | - 'UG221' => __( 'Butaleja', 'invoicing' ), | |
| 1355 | - 'UG119' => __( 'Butambala', 'invoicing' ), | |
| 1356 | - 'UG233' => __( 'Butebo', 'invoicing' ), | |
| 1357 | - 'UG120' => __( 'Buvuma', 'invoicing' ), | |
| 1358 | - 'UG226' => __( 'Buyende', 'invoicing' ), | |
| 1359 | - 'UG317' => __( 'Dokolo', 'invoicing' ), | |
| 1360 | - 'UG121' => __( 'Gomba', 'invoicing' ), | |
| 1361 | - 'UG304' => __( 'Gulu', 'invoicing' ), | |
| 1362 | - 'UG403' => __( 'Hoima', 'invoicing' ), | |
| 1363 | - 'UG417' => __( 'Ibanda', 'invoicing' ), | |
| 1364 | - 'UG203' => __( 'Iganga', 'invoicing' ), | |
| 1365 | - 'UG418' => __( 'Isingiro', 'invoicing' ), | |
| 1366 | - 'UG204' => __( 'Jinja', 'invoicing' ), | |
| 1367 | - 'UG318' => __( 'Kaabong', 'invoicing' ), | |
| 1368 | - 'UG404' => __( 'Kabale', 'invoicing' ), | |
| 1369 | - 'UG405' => __( 'Kabarole', 'invoicing' ), | |
| 1370 | - 'UG213' => __( 'Kaberamaido', 'invoicing' ), | |
| 1371 | - 'UG427' => __( 'Kagadi', 'invoicing' ), | |
| 1372 | - 'UG428' => __( 'Kakumiro', 'invoicing' ), | |
| 1373 | - 'UG101' => __( 'Kalangala', 'invoicing' ), | |
| 1374 | - 'UG222' => __( 'Kaliro', 'invoicing' ), | |
| 1375 | - 'UG122' => __( 'Kalungu', 'invoicing' ), | |
| 1376 | - 'UG102' => __( 'Kampala', 'invoicing' ), | |
| 1377 | - 'UG205' => __( 'Kamuli', 'invoicing' ), | |
| 1378 | - 'UG413' => __( 'Kamwenge', 'invoicing' ), | |
| 1379 | - 'UG414' => __( 'Kanungu', 'invoicing' ), | |
| 1380 | - 'UG206' => __( 'Kapchorwa', 'invoicing' ), | |
| 1381 | - 'UG236' => __( 'Kapelebyong', 'invoicing' ), | |
| 1382 | - 'UG126' => __( 'Kasanda', 'invoicing' ), | |
| 1383 | - 'UG406' => __( 'Kasese', 'invoicing' ), | |
| 1384 | - 'UG207' => __( 'Katakwi', 'invoicing' ), | |
| 1385 | - 'UG112' => __( 'Kayunga', 'invoicing' ), | |
| 1386 | - 'UG407' => __( 'Kibaale', 'invoicing' ), | |
| 1387 | - 'UG103' => __( 'Kiboga', 'invoicing' ), | |
| 1388 | - 'UG227' => __( 'Kibuku', 'invoicing' ), | |
| 1389 | - 'UG432' => __( 'Kikuube', 'invoicing' ), | |
| 1390 | - 'UG419' => __( 'Kiruhura', 'invoicing' ), | |
| 1391 | - 'UG421' => __( 'Kiryandongo', 'invoicing' ), | |
| 1392 | - 'UG408' => __( 'Kisoro', 'invoicing' ), | |
| 1393 | - 'UG305' => __( 'Kitgum', 'invoicing' ), | |
| 1394 | - 'UG319' => __( 'Koboko', 'invoicing' ), | |
| 1395 | - 'UG325' => __( 'Kole', 'invoicing' ), | |
| 1396 | - 'UG306' => __( 'Kotido', 'invoicing' ), | |
| 1397 | - 'UG208' => __( 'Kumi', 'invoicing' ), | |
| 1398 | - 'UG333' => __( 'Kwania', 'invoicing' ), | |
| 1399 | - 'UG228' => __( 'Kween', 'invoicing' ), | |
| 1400 | - 'UG123' => __( 'Kyankwanzi', 'invoicing' ), | |
| 1401 | - 'UG422' => __( 'Kyegegwa', 'invoicing' ), | |
| 1402 | - 'UG415' => __( 'Kyenjojo', 'invoicing' ), | |
| 1403 | - 'UG125' => __( 'Kyotera', 'invoicing' ), | |
| 1404 | - 'UG326' => __( 'Lamwo', 'invoicing' ), | |
| 1405 | - 'UG307' => __( 'Lira', 'invoicing' ), | |
| 1406 | - 'UG229' => __( 'Luuka', 'invoicing' ), | |
| 1407 | - 'UG104' => __( 'Luwero', 'invoicing' ), | |
| 1408 | - 'UG124' => __( 'Lwengo', 'invoicing' ), | |
| 1409 | - 'UG114' => __( 'Lyantonde', 'invoicing' ), | |
| 1410 | - 'UG223' => __( 'Manafwa', 'invoicing' ), | |
| 1411 | - 'UG320' => __( 'Maracha', 'invoicing' ), | |
| 1412 | - 'UG105' => __( 'Masaka', 'invoicing' ), | |
| 1413 | - 'UG409' => __( 'Masindi', 'invoicing' ), | |
| 1414 | - 'UG214' => __( 'Mayuge', 'invoicing' ), | |
| 1415 | - 'UG209' => __( 'Mbale', 'invoicing' ), | |
| 1416 | - 'UG410' => __( 'Mbarara', 'invoicing' ), | |
| 1417 | - 'UG423' => __( 'Mitooma', 'invoicing' ), | |
| 1418 | - 'UG115' => __( 'Mityana', 'invoicing' ), | |
| 1419 | - 'UG308' => __( 'Moroto', 'invoicing' ), | |
| 1420 | - 'UG309' => __( 'Moyo', 'invoicing' ), | |
| 1421 | - 'UG106' => __( 'Mpigi', 'invoicing' ), | |
| 1422 | - 'UG107' => __( 'Mubende', 'invoicing' ), | |
| 1423 | - 'UG108' => __( 'Mukono', 'invoicing' ), | |
| 1424 | - 'UG334' => __( 'Nabilatuk', 'invoicing' ), | |
| 1425 | - 'UG311' => __( 'Nakapiripirit', 'invoicing' ), | |
| 1426 | - 'UG116' => __( 'Nakaseke', 'invoicing' ), | |
| 1427 | - 'UG109' => __( 'Nakasongola', 'invoicing' ), | |
| 1428 | - 'UG230' => __( 'Namayingo', 'invoicing' ), | |
| 1429 | - 'UG234' => __( 'Namisindwa', 'invoicing' ), | |
| 1430 | - 'UG224' => __( 'Namutumba', 'invoicing' ), | |
| 1431 | - 'UG327' => __( 'Napak', 'invoicing' ), | |
| 1432 | - 'UG310' => __( 'Nebbi', 'invoicing' ), | |
| 1433 | - 'UG231' => __( 'Ngora', 'invoicing' ), | |
| 1434 | - 'UG424' => __( 'Ntoroko', 'invoicing' ), | |
| 1435 | - 'UG411' => __( 'Ntungamo', 'invoicing' ), | |
| 1436 | - 'UG328' => __( 'Nwoya', 'invoicing' ), | |
| 1437 | - 'UG331' => __( 'Omoro', 'invoicing' ), | |
| 1438 | - 'UG329' => __( 'Otuke', 'invoicing' ), | |
| 1439 | - 'UG321' => __( 'Oyam', 'invoicing' ), | |
| 1440 | - 'UG312' => __( 'Pader', 'invoicing' ), | |
| 1441 | - 'UG332' => __( 'Pakwach', 'invoicing' ), | |
| 1442 | - 'UG210' => __( 'Pallisa', 'invoicing' ), | |
| 1443 | - 'UG110' => __( 'Rakai', 'invoicing' ), | |
| 1444 | - 'UG429' => __( 'Rubanda', 'invoicing' ), | |
| 1445 | - 'UG425' => __( 'Rubirizi', 'invoicing' ), | |
| 1446 | - 'UG431' => __( 'Rukiga', 'invoicing' ), | |
| 1447 | - 'UG412' => __( 'Rukungiri', 'invoicing' ), | |
| 1448 | - 'UG111' => __( 'Sembabule', 'invoicing' ), | |
| 1449 | - 'UG232' => __( 'Serere', 'invoicing' ), | |
| 1450 | - 'UG426' => __( 'Sheema', 'invoicing' ), | |
| 1451 | - 'UG215' => __( 'Sironko', 'invoicing' ), | |
| 1452 | - 'UG211' => __( 'Soroti', 'invoicing' ), | |
| 1453 | - 'UG212' => __( 'Tororo', 'invoicing' ), | |
| 1454 | - 'UG113' => __( 'Wakiso', 'invoicing' ), | |
| 1455 | - 'UG313' => __( 'Yumbe', 'invoicing' ), | |
| 1456 | - 'UG330' => __( 'Zombo', 'invoicing' ), | |
| 1457 | - ), | |
| 1458 | - 'UM' => array( | |
| 1459 | - '81' => __( 'Baker Island', 'invoicing' ), | |
| 1460 | - '84' => __( 'Howland Island', 'invoicing' ), | |
| 1461 | - '86' => __( 'Jarvis Island', 'invoicing' ), | |
| 1462 | - '67' => __( 'Johnston Atoll', 'invoicing' ), | |
| 1463 | - '89' => __( 'Kingman Reef', 'invoicing' ), | |
| 1464 | - '71' => __( 'Midway Atoll', 'invoicing' ), | |
| 1465 | - '76' => __( 'Navassa Island', 'invoicing' ), | |
| 1466 | - '95' => __( 'Palmyra Atoll', 'invoicing' ), | |
| 1467 | - '79' => __( 'Wake Island', 'invoicing' ), | |
| 1468 | - ), | |
| 1469 | - 'US' => array( // United States. | |
| 1470 | - 'AL' => __( 'Alabama', 'invoicing' ), | |
| 1471 | - 'AK' => __( 'Alaska', 'invoicing' ), | |
| 1472 | - 'AZ' => __( 'Arizona', 'invoicing' ), | |
| 1473 | - 'AR' => __( 'Arkansas', 'invoicing' ), | |
| 1474 | - 'CA' => __( 'California', 'invoicing' ), | |
| 1475 | - 'CO' => __( 'Colorado', 'invoicing' ), | |
| 1476 | - 'CT' => __( 'Connecticut', 'invoicing' ), | |
| 1477 | - 'DE' => __( 'Delaware', 'invoicing' ), | |
| 1478 | - 'DC' => __( 'District Of Columbia', 'invoicing' ), | |
| 1479 | - 'FL' => __( 'Florida', 'invoicing' ), | |
| 1480 | - 'GA' => _x( 'Georgia', 'US state of Georgia', 'invoicing' ), | |
| 1481 | - 'HI' => __( 'Hawaii', 'invoicing' ), | |
| 1482 | - 'ID' => __( 'Idaho', 'invoicing' ), | |
| 1483 | - 'IL' => __( 'Illinois', 'invoicing' ), | |
| 1484 | - 'IN' => __( 'Indiana', 'invoicing' ), | |
| 1485 | - 'IA' => __( 'Iowa', 'invoicing' ), | |
| 1486 | - 'KS' => __( 'Kansas', 'invoicing' ), | |
| 1487 | - 'KY' => __( 'Kentucky', 'invoicing' ), | |
| 1488 | - 'LA' => __( 'Louisiana', 'invoicing' ), | |
| 1489 | - 'ME' => __( 'Maine', 'invoicing' ), | |
| 1490 | - 'MD' => __( 'Maryland', 'invoicing' ), | |
| 1491 | - 'MA' => __( 'Massachusetts', 'invoicing' ), | |
| 1492 | - 'MI' => __( 'Michigan', 'invoicing' ), | |
| 1493 | - 'MN' => __( 'Minnesota', 'invoicing' ), | |
| 1494 | - 'MS' => __( 'Mississippi', 'invoicing' ), | |
| 1495 | - 'MO' => __( 'Missouri', 'invoicing' ), | |
| 1496 | - 'MT' => __( 'Montana', 'invoicing' ), | |
| 1497 | - 'NE' => __( 'Nebraska', 'invoicing' ), | |
| 1498 | - 'NV' => __( 'Nevada', 'invoicing' ), | |
| 1499 | - 'NH' => __( 'New Hampshire', 'invoicing' ), | |
| 1500 | - 'NJ' => __( 'New Jersey', 'invoicing' ), | |
| 1501 | - 'NM' => __( 'New Mexico', 'invoicing' ), | |
| 1502 | - 'NY' => __( 'New York', 'invoicing' ), | |
| 1503 | - 'NC' => __( 'North Carolina', 'invoicing' ), | |
| 1504 | - 'ND' => __( 'North Dakota', 'invoicing' ), | |
| 1505 | - 'OH' => __( 'Ohio', 'invoicing' ), | |
| 1506 | - 'OK' => __( 'Oklahoma', 'invoicing' ), | |
| 1507 | - 'OR' => __( 'Oregon', 'invoicing' ), | |
| 1508 | - 'PA' => __( 'Pennsylvania', 'invoicing' ), | |
| 1509 | - 'RI' => __( 'Rhode Island', 'invoicing' ), | |
| 1510 | - 'SC' => __( 'South Carolina', 'invoicing' ), | |
| 1511 | - 'SD' => __( 'South Dakota', 'invoicing' ), | |
| 1512 | - 'TN' => __( 'Tennessee', 'invoicing' ), | |
| 1513 | - 'TX' => __( 'Texas', 'invoicing' ), | |
| 1514 | - 'UT' => __( 'Utah', 'invoicing' ), | |
| 1515 | - 'VT' => __( 'Vermont', 'invoicing' ), | |
| 1516 | - 'VA' => __( 'Virginia', 'invoicing' ), | |
| 1517 | - 'WA' => __( 'Washington', 'invoicing' ), | |
| 1518 | - 'WV' => __( 'West Virginia', 'invoicing' ), | |
| 1519 | - 'WI' => __( 'Wisconsin', 'invoicing' ), | |
| 1520 | - 'WY' => __( 'Wyoming', 'invoicing' ), | |
| 1521 | - 'AA' => __( 'Armed Forces (AA)', 'invoicing' ), | |
| 1522 | - 'AE' => __( 'Armed Forces (AE)', 'invoicing' ), | |
| 1523 | - 'AP' => __( 'Armed Forces (AP)', 'invoicing' ), | |
| 1524 | - ), | |
| 1525 | - 'VN' => array(), | |
| 1526 | - 'YT' => array(), | |
| 1527 | - 'ZA' => array( // South African states. | |
| 1528 | - 'EC' => __( 'Eastern Cape', 'invoicing' ), | |
| 1529 | - 'FS' => __( 'Free State', 'invoicing' ), | |
| 1530 | - 'GP' => __( 'Gauteng', 'invoicing' ), | |
| 1531 | - 'KZN' => __( 'KwaZulu-Natal', 'invoicing' ), | |
| 1532 | - 'LP' => __( 'Limpopo', 'invoicing' ), | |
| 1533 | - 'MP' => __( 'Mpumalanga', 'invoicing' ), | |
| 1534 | - 'NC' => __( 'Northern Cape', 'invoicing' ), | |
| 1535 | - 'NW' => __( 'North West', 'invoicing' ), | |
| 1536 | - 'WC' => __( 'Western Cape', 'invoicing' ), | |
| 1537 | - ), | |
| 1538 | - 'ZM' => array( // Zambia's Provinces. Ref: https://en.wikipedia.org/wiki/ISO_3166-2:ZM. | |
| 1539 | - 'ZM-01' => __( 'Western', 'invoicing' ), | |
| 1540 | - 'ZM-02' => __( 'Central', 'invoicing' ), | |
| 1541 | - 'ZM-03' => __( 'Eastern', 'invoicing' ), | |
| 1542 | - 'ZM-04' => __( 'Luapula', 'invoicing' ), | |
| 1543 | - 'ZM-05' => __( 'Northern', 'invoicing' ), | |
| 1544 | - 'ZM-06' => __( 'North-Western', 'invoicing' ), | |
| 1545 | - 'ZM-07' => __( 'Southern', 'invoicing' ), | |
| 1546 | - 'ZM-08' => __( 'Copperbelt', 'invoicing' ), | |
| 1547 | - 'ZM-09' => __( 'Lusaka', 'invoicing' ), | |
| 1548 | - 'ZM-10' => __( 'Muchinga', 'invoicing' ), | |
| 1549 | - ), | |
| 964 | + /** | |
| 965 | + * Philippine Provinces. | |
| 966 | + */ | |
| 967 | + 'PH' => array( | |
| 968 | + 'ABR' => __( 'Abra', 'invoicing' ), | |
| 969 | + 'AGN' => __( 'Agusan del Norte', 'invoicing' ), | |
| 970 | + 'AGS' => __( 'Agusan del Sur', 'invoicing' ), | |
| 971 | + 'AKL' => __( 'Aklan', 'invoicing' ), | |
| 972 | + 'ALB' => __( 'Albay', 'invoicing' ), | |
| 973 | + 'ANT' => __( 'Antique', 'invoicing' ), | |
| 974 | + 'APA' => __( 'Apayao', 'invoicing' ), | |
| 975 | + 'AUR' => __( 'Aurora', 'invoicing' ), | |
| 976 | + 'BAS' => __( 'Basilan', 'invoicing' ), | |
| 977 | + 'BAN' => __( 'Bataan', 'invoicing' ), | |
| 978 | + 'BTN' => __( 'Batanes', 'invoicing' ), | |
| 979 | + 'BTG' => __( 'Batangas', 'invoicing' ), | |
| 980 | + 'BEN' => __( 'Benguet', 'invoicing' ), | |
| 981 | + 'BIL' => __( 'Biliran', 'invoicing' ), | |
| 982 | + 'BOH' => __( 'Bohol', 'invoicing' ), | |
| 983 | + 'BUK' => __( 'Bukidnon', 'invoicing' ), | |
| 984 | + 'BUL' => __( 'Bulacan', 'invoicing' ), | |
| 985 | + 'CAG' => __( 'Cagayan', 'invoicing' ), | |
| 986 | + 'CAN' => __( 'Camarines Norte', 'invoicing' ), | |
| 987 | + 'CAS' => __( 'Camarines Sur', 'invoicing' ), | |
| 988 | + 'CAM' => __( 'Camiguin', 'invoicing' ), | |
| 989 | + 'CAP' => __( 'Capiz', 'invoicing' ), | |
| 990 | + 'CAT' => __( 'Catanduanes', 'invoicing' ), | |
| 991 | + 'CAV' => __( 'Cavite', 'invoicing' ), | |
| 992 | + 'CEB' => __( 'Cebu', 'invoicing' ), | |
| 993 | + 'COM' => __( 'Compostela Valley', 'invoicing' ), | |
| 994 | + 'NCO' => __( 'Cotabato', 'invoicing' ), | |
| 995 | + 'DAV' => __( 'Davao del Norte', 'invoicing' ), | |
| 996 | + 'DAS' => __( 'Davao del Sur', 'invoicing' ), | |
| 997 | + 'DAC' => __( 'Davao Occidental', 'invoicing' ), | |
| 998 | + 'DAO' => __( 'Davao Oriental', 'invoicing' ), | |
| 999 | + 'DIN' => __( 'Dinagat Islands', 'invoicing' ), | |
| 1000 | + 'EAS' => __( 'Eastern Samar', 'invoicing' ), | |
| 1001 | + 'GUI' => __( 'Guimaras', 'invoicing' ), | |
| 1002 | + 'IFU' => __( 'Ifugao', 'invoicing' ), | |
| 1003 | + 'ILN' => __( 'Ilocos Norte', 'invoicing' ), | |
| 1004 | + 'ILS' => __( 'Ilocos Sur', 'invoicing' ), | |
| 1005 | + 'ILI' => __( 'Iloilo', 'invoicing' ), | |
| 1006 | + 'ISA' => __( 'Isabela', 'invoicing' ), | |
| 1007 | + 'KAL' => __( 'Kalinga', 'invoicing' ), | |
| 1008 | + 'LUN' => __( 'La Union', 'invoicing' ), | |
| 1009 | + 'LAG' => __( 'Laguna', 'invoicing' ), | |
| 1010 | + 'LAN' => __( 'Lanao del Norte', 'invoicing' ), | |
| 1011 | + 'LAS' => __( 'Lanao del Sur', 'invoicing' ), | |
| 1012 | + 'LEY' => __( 'Leyte', 'invoicing' ), | |
| 1013 | + 'MAG' => __( 'Maguindanao', 'invoicing' ), | |
| 1014 | + 'MAD' => __( 'Marinduque', 'invoicing' ), | |
| 1015 | + 'MAS' => __( 'Masbate', 'invoicing' ), | |
| 1016 | + 'MSC' => __( 'Misamis Occidental', 'invoicing' ), | |
| 1017 | + 'MSR' => __( 'Misamis Oriental', 'invoicing' ), | |
| 1018 | + 'MOU' => __( 'Mountain Province', 'invoicing' ), | |
| 1019 | + 'NEC' => __( 'Negros Occidental', 'invoicing' ), | |
| 1020 | + 'NER' => __( 'Negros Oriental', 'invoicing' ), | |
| 1021 | + 'NSA' => __( 'Northern Samar', 'invoicing' ), | |
| 1022 | + 'NUE' => __( 'Nueva Ecija', 'invoicing' ), | |
| 1023 | + 'NUV' => __( 'Nueva Vizcaya', 'invoicing' ), | |
| 1024 | + 'MDC' => __( 'Occidental Mindoro', 'invoicing' ), | |
| 1025 | + 'MDR' => __( 'Oriental Mindoro', 'invoicing' ), | |
| 1026 | + 'PLW' => __( 'Palawan', 'invoicing' ), | |
| 1027 | + 'PAM' => __( 'Pampanga', 'invoicing' ), | |
| 1028 | + 'PAN' => __( 'Pangasinan', 'invoicing' ), | |
| 1029 | + 'QUE' => __( 'Quezon', 'invoicing' ), | |
| 1030 | + 'QUI' => __( 'Quirino', 'invoicing' ), | |
| 1031 | + 'RIZ' => __( 'Rizal', 'invoicing' ), | |
| 1032 | + 'ROM' => __( 'Romblon', 'invoicing' ), | |
| 1033 | + 'WSA' => __( 'Samar', 'invoicing' ), | |
| 1034 | + 'SAR' => __( 'Sarangani', 'invoicing' ), | |
| 1035 | + 'SIQ' => __( 'Siquijor', 'invoicing' ), | |
| 1036 | + 'SOR' => __( 'Sorsogon', 'invoicing' ), | |
| 1037 | + 'SCO' => __( 'South Cotabato', 'invoicing' ), | |
| 1038 | + 'SLE' => __( 'Southern Leyte', 'invoicing' ), | |
| 1039 | + 'SUK' => __( 'Sultan Kudarat', 'invoicing' ), | |
| 1040 | + 'SLU' => __( 'Sulu', 'invoicing' ), | |
| 1041 | + 'SUN' => __( 'Surigao del Norte', 'invoicing' ), | |
| 1042 | + 'SUR' => __( 'Surigao del Sur', 'invoicing' ), | |
| 1043 | + 'TAR' => __( 'Tarlac', 'invoicing' ), | |
| 1044 | + 'TAW' => __( 'Tawi-Tawi', 'invoicing' ), | |
| 1045 | + 'ZMB' => __( 'Zambales', 'invoicing' ), | |
| 1046 | + 'ZAN' => __( 'Zamboanga del Norte', 'invoicing' ), | |
| 1047 | + 'ZAS' => __( 'Zamboanga del Sur', 'invoicing' ), | |
| 1048 | + 'ZSI' => __( 'Zamboanga Sibugay', 'invoicing' ), | |
| 1049 | + '00' => __( 'Metro Manila', 'invoicing' ), | |
| 1050 | + ), | |
| 1051 | + 'PK' => array( // Pakistan's states. | |
| 1052 | + 'JK' => __( 'Azad Kashmir', 'invoicing' ), | |
| 1053 | + 'BA' => __( 'Balochistan', 'invoicing' ), | |
| 1054 | + 'TA' => __( 'FATA', 'invoicing' ), | |
| 1055 | + 'GB' => __( 'Gilgit Baltistan', 'invoicing' ), | |
| 1056 | + 'IS' => __( 'Islamabad Capital Territory', 'invoicing' ), | |
| 1057 | + 'KP' => __( 'Khyber Pakhtunkhwa', 'invoicing' ), | |
| 1058 | + 'PB' => __( 'Punjab', 'invoicing' ), | |
| 1059 | + 'SD' => __( 'Sindh', 'invoicing' ), | |
| 1060 | + ), | |
| 1061 | + 'PL' => array(), | |
| 1062 | + 'PT' => array(), | |
| 1063 | + 'PY' => array( // Paraguay states. | |
| 1064 | + 'PY-ASU' => __( 'Asunción', 'invoicing' ), | |
| 1065 | + 'PY-1' => __( 'Concepción', 'invoicing' ), | |
| 1066 | + 'PY-2' => __( 'San Pedro', 'invoicing' ), | |
| 1067 | + 'PY-3' => __( 'Cordillera', 'invoicing' ), | |
| 1068 | + 'PY-4' => __( 'Guairá', 'invoicing' ), | |
| 1069 | + 'PY-5' => __( 'Caaguazú', 'invoicing' ), | |
| 1070 | + 'PY-6' => __( 'Caazapá', 'invoicing' ), | |
| 1071 | + 'PY-7' => __( 'Itapúa', 'invoicing' ), | |
| 1072 | + 'PY-8' => __( 'Misiones', 'invoicing' ), | |
| 1073 | + 'PY-9' => __( 'Paraguarí', 'invoicing' ), | |
| 1074 | + 'PY-10' => __( 'Alto Paraná', 'invoicing' ), | |
| 1075 | + 'PY-11' => __( 'Central', 'invoicing' ), | |
| 1076 | + 'PY-12' => __( 'Ñeembucú', 'invoicing' ), | |
| 1077 | + 'PY-13' => __( 'Amambay', 'invoicing' ), | |
| 1078 | + 'PY-14' => __( 'Canindeyú', 'invoicing' ), | |
| 1079 | + 'PY-15' => __( 'Presidente Hayes', 'invoicing' ), | |
| 1080 | + 'PY-16' => __( 'Alto Paraguay', 'invoicing' ), | |
| 1081 | + 'PY-17' => __( 'Boquerón', 'invoicing' ), | |
| 1082 | + ), | |
| 1083 | + 'RE' => array(), | |
| 1084 | + 'RO' => array( // Romania states. | |
| 1085 | + 'AB' => __( 'Alba', 'invoicing' ), | |
| 1086 | + 'AR' => __( 'Arad', 'invoicing' ), | |
| 1087 | + 'AG' => __( 'Argeș', 'invoicing' ), | |
| 1088 | + 'BC' => __( 'Bacău', 'invoicing' ), | |
| 1089 | + 'BH' => __( 'Bihor', 'invoicing' ), | |
| 1090 | + 'BN' => __( 'Bistrița-Năsăud', 'invoicing' ), | |
| 1091 | + 'BT' => __( 'Botoșani', 'invoicing' ), | |
| 1092 | + 'BR' => __( 'Brăila', 'invoicing' ), | |
| 1093 | + 'BV' => __( 'Brașov', 'invoicing' ), | |
| 1094 | + 'B' => __( 'București', 'invoicing' ), | |
| 1095 | + 'BZ' => __( 'Buzău', 'invoicing' ), | |
| 1096 | + 'CL' => __( 'Călărași', 'invoicing' ), | |
| 1097 | + 'CS' => __( 'Caraș-Severin', 'invoicing' ), | |
| 1098 | + 'CJ' => __( 'Cluj', 'invoicing' ), | |
| 1099 | + 'CT' => __( 'Constanța', 'invoicing' ), | |
| 1100 | + 'CV' => __( 'Covasna', 'invoicing' ), | |
| 1101 | + 'DB' => __( 'Dâmbovița', 'invoicing' ), | |
| 1102 | + 'DJ' => __( 'Dolj', 'invoicing' ), | |
| 1103 | + 'GL' => __( 'Galați', 'invoicing' ), | |
| 1104 | + 'GR' => __( 'Giurgiu', 'invoicing' ), | |
| 1105 | + 'GJ' => __( 'Gorj', 'invoicing' ), | |
| 1106 | + 'HR' => __( 'Harghita', 'invoicing' ), | |
| 1107 | + 'HD' => __( 'Hunedoara', 'invoicing' ), | |
| 1108 | + 'IL' => __( 'Ialomița', 'invoicing' ), | |
| 1109 | + 'IS' => __( 'Iași', 'invoicing' ), | |
| 1110 | + 'IF' => __( 'Ilfov', 'invoicing' ), | |
| 1111 | + 'MM' => __( 'Maramureș', 'invoicing' ), | |
| 1112 | + 'MH' => __( 'Mehedinți', 'invoicing' ), | |
| 1113 | + 'MS' => __( 'Mureș', 'invoicing' ), | |
| 1114 | + 'NT' => __( 'Neamț', 'invoicing' ), | |
| 1115 | + 'OT' => __( 'Olt', 'invoicing' ), | |
| 1116 | + 'PH' => __( 'Prahova', 'invoicing' ), | |
| 1117 | + 'SJ' => __( 'Sălaj', 'invoicing' ), | |
| 1118 | + 'SM' => __( 'Satu Mare', 'invoicing' ), | |
| 1119 | + 'SB' => __( 'Sibiu', 'invoicing' ), | |
| 1120 | + 'SV' => __( 'Suceava', 'invoicing' ), | |
| 1121 | + 'TR' => __( 'Teleorman', 'invoicing' ), | |
| 1122 | + 'TM' => __( 'Timiș', 'invoicing' ), | |
| 1123 | + 'TL' => __( 'Tulcea', 'invoicing' ), | |
| 1124 | + 'VL' => __( 'Vâlcea', 'invoicing' ), | |
| 1125 | + 'VS' => __( 'Vaslui', 'invoicing' ), | |
| 1126 | + 'VN' => __( 'Vrancea', 'invoicing' ), | |
| 1127 | + ), | |
| 1128 | + 'RS' => array(), | |
| 1129 | + 'SG' => array(), | |
| 1130 | + 'SK' => array(), | |
| 1131 | + 'SI' => array(), | |
| 1132 | + 'TH' => array( // Thailand states. | |
| 1133 | + 'TH-37' => __( 'Amnat Charoen', 'invoicing' ), | |
| 1134 | + 'TH-15' => __( 'Ang Thong', 'invoicing' ), | |
| 1135 | + 'TH-14' => __( 'Ayutthaya', 'invoicing' ), | |
| 1136 | + 'TH-10' => __( 'Bangkok', 'invoicing' ), | |
| 1137 | + 'TH-38' => __( 'Bueng Kan', 'invoicing' ), | |
| 1138 | + 'TH-31' => __( 'Buri Ram', 'invoicing' ), | |
| 1139 | + 'TH-24' => __( 'Chachoengsao', 'invoicing' ), | |
| 1140 | + 'TH-18' => __( 'Chai Nat', 'invoicing' ), | |
| 1141 | + 'TH-36' => __( 'Chaiyaphum', 'invoicing' ), | |
| 1142 | + 'TH-22' => __( 'Chanthaburi', 'invoicing' ), | |
| 1143 | + 'TH-50' => __( 'Chiang Mai', 'invoicing' ), | |
| 1144 | + 'TH-57' => __( 'Chiang Rai', 'invoicing' ), | |
| 1145 | + 'TH-20' => __( 'Chonburi', 'invoicing' ), | |
| 1146 | + 'TH-86' => __( 'Chumphon', 'invoicing' ), | |
| 1147 | + 'TH-46' => __( 'Kalasin', 'invoicing' ), | |
| 1148 | + 'TH-62' => __( 'Kamphaeng Phet', 'invoicing' ), | |
| 1149 | + 'TH-71' => __( 'Kanchanaburi', 'invoicing' ), | |
| 1150 | + 'TH-40' => __( 'Khon Kaen', 'invoicing' ), | |
| 1151 | + 'TH-81' => __( 'Krabi', 'invoicing' ), | |
| 1152 | + 'TH-52' => __( 'Lampang', 'invoicing' ), | |
| 1153 | + 'TH-51' => __( 'Lamphun', 'invoicing' ), | |
| 1154 | + 'TH-42' => __( 'Loei', 'invoicing' ), | |
| 1155 | + 'TH-16' => __( 'Lopburi', 'invoicing' ), | |
| 1156 | + 'TH-58' => __( 'Mae Hong Son', 'invoicing' ), | |
| 1157 | + 'TH-44' => __( 'Maha Sarakham', 'invoicing' ), | |
| 1158 | + 'TH-49' => __( 'Mukdahan', 'invoicing' ), | |
| 1159 | + 'TH-26' => __( 'Nakhon Nayok', 'invoicing' ), | |
| 1160 | + 'TH-73' => __( 'Nakhon Pathom', 'invoicing' ), | |
| 1161 | + 'TH-48' => __( 'Nakhon Phanom', 'invoicing' ), | |
| 1162 | + 'TH-30' => __( 'Nakhon Ratchasima', 'invoicing' ), | |
| 1163 | + 'TH-60' => __( 'Nakhon Sawan', 'invoicing' ), | |
| 1164 | + 'TH-80' => __( 'Nakhon Si Thammarat', 'invoicing' ), | |
| 1165 | + 'TH-55' => __( 'Nan', 'invoicing' ), | |
| 1166 | + 'TH-96' => __( 'Narathiwat', 'invoicing' ), | |
| 1167 | + 'TH-39' => __( 'Nong Bua Lam Phu', 'invoicing' ), | |
| 1168 | + 'TH-43' => __( 'Nong Khai', 'invoicing' ), | |
| 1169 | + 'TH-12' => __( 'Nonthaburi', 'invoicing' ), | |
| 1170 | + 'TH-13' => __( 'Pathum Thani', 'invoicing' ), | |
| 1171 | + 'TH-94' => __( 'Pattani', 'invoicing' ), | |
| 1172 | + 'TH-82' => __( 'Phang Nga', 'invoicing' ), | |
| 1173 | + 'TH-93' => __( 'Phatthalung', 'invoicing' ), | |
| 1174 | + 'TH-56' => __( 'Phayao', 'invoicing' ), | |
| 1175 | + 'TH-67' => __( 'Phetchabun', 'invoicing' ), | |
| 1176 | + 'TH-76' => __( 'Phetchaburi', 'invoicing' ), | |
| 1177 | + 'TH-66' => __( 'Phichit', 'invoicing' ), | |
| 1178 | + 'TH-65' => __( 'Phitsanulok', 'invoicing' ), | |
| 1179 | + 'TH-54' => __( 'Phrae', 'invoicing' ), | |
| 1180 | + 'TH-83' => __( 'Phuket', 'invoicing' ), | |
| 1181 | + 'TH-25' => __( 'Prachin Buri', 'invoicing' ), | |
| 1182 | + 'TH-77' => __( 'Prachuap Khiri Khan', 'invoicing' ), | |
| 1183 | + 'TH-85' => __( 'Ranong', 'invoicing' ), | |
| 1184 | + 'TH-70' => __( 'Ratchaburi', 'invoicing' ), | |
| 1185 | + 'TH-21' => __( 'Rayong', 'invoicing' ), | |
| 1186 | + 'TH-45' => __( 'Roi Et', 'invoicing' ), | |
| 1187 | + 'TH-27' => __( 'Sa Kaeo', 'invoicing' ), | |
| 1188 | + 'TH-47' => __( 'Sakon Nakhon', 'invoicing' ), | |
| 1189 | + 'TH-11' => __( 'Samut Prakan', 'invoicing' ), | |
| 1190 | + 'TH-74' => __( 'Samut Sakhon', 'invoicing' ), | |
| 1191 | + 'TH-75' => __( 'Samut Songkhram', 'invoicing' ), | |
| 1192 | + 'TH-19' => __( 'Saraburi', 'invoicing' ), | |
| 1193 | + 'TH-91' => __( 'Satun', 'invoicing' ), | |
| 1194 | + 'TH-17' => __( 'Sing Buri', 'invoicing' ), | |
| 1195 | + 'TH-33' => __( 'Sisaket', 'invoicing' ), | |
| 1196 | + 'TH-90' => __( 'Songkhla', 'invoicing' ), | |
| 1197 | + 'TH-64' => __( 'Sukhothai', 'invoicing' ), | |
| 1198 | + 'TH-72' => __( 'Suphan Buri', 'invoicing' ), | |
| 1199 | + 'TH-84' => __( 'Surat Thani', 'invoicing' ), | |
| 1200 | + 'TH-32' => __( 'Surin', 'invoicing' ), | |
| 1201 | + 'TH-63' => __( 'Tak', 'invoicing' ), | |
| 1202 | + 'TH-92' => __( 'Trang', 'invoicing' ), | |
| 1203 | + 'TH-23' => __( 'Trat', 'invoicing' ), | |
| 1204 | + 'TH-34' => __( 'Ubon Ratchathani', 'invoicing' ), | |
| 1205 | + 'TH-41' => __( 'Udon Thani', 'invoicing' ), | |
| 1206 | + 'TH-61' => __( 'Uthai Thani', 'invoicing' ), | |
| 1207 | + 'TH-53' => __( 'Uttaradit', 'invoicing' ), | |
| 1208 | + 'TH-95' => __( 'Yala', 'invoicing' ), | |
| 1209 | + 'TH-35' => __( 'Yasothon', 'invoicing' ), | |
| 1210 | + ), | |
| 1211 | + 'TR' => array( // Turkey States. | |
| 1212 | + 'TR01' => __( 'Adana', 'invoicing' ), | |
| 1213 | + 'TR02' => __( 'Adıyaman', 'invoicing' ), | |
| 1214 | + 'TR03' => __( 'Afyon', 'invoicing' ), | |
| 1215 | + 'TR04' => __( 'Ağrı', 'invoicing' ), | |
| 1216 | + 'TR05' => __( 'Amasya', 'invoicing' ), | |
| 1217 | + 'TR06' => __( 'Ankara', 'invoicing' ), | |
| 1218 | + 'TR07' => __( 'Antalya', 'invoicing' ), | |
| 1219 | + 'TR08' => __( 'Artvin', 'invoicing' ), | |
| 1220 | + 'TR09' => __( 'Aydın', 'invoicing' ), | |
| 1221 | + 'TR10' => __( 'Balıkesir', 'invoicing' ), | |
| 1222 | + 'TR11' => __( 'Bilecik', 'invoicing' ), | |
| 1223 | + 'TR12' => __( 'Bingöl', 'invoicing' ), | |
| 1224 | + 'TR13' => __( 'Bitlis', 'invoicing' ), | |
| 1225 | + 'TR14' => __( 'Bolu', 'invoicing' ), | |
| 1226 | + 'TR15' => __( 'Burdur', 'invoicing' ), | |
| 1227 | + 'TR16' => __( 'Bursa', 'invoicing' ), | |
| 1228 | + 'TR17' => __( 'Çanakkale', 'invoicing' ), | |
| 1229 | + 'TR18' => __( 'Çankırı', 'invoicing' ), | |
| 1230 | + 'TR19' => __( 'Çorum', 'invoicing' ), | |
| 1231 | + 'TR20' => __( 'Denizli', 'invoicing' ), | |
| 1232 | + 'TR21' => __( 'Diyarbakır', 'invoicing' ), | |
| 1233 | + 'TR22' => __( 'Edirne', 'invoicing' ), | |
| 1234 | + 'TR23' => __( 'Elazığ', 'invoicing' ), | |
| 1235 | + 'TR24' => __( 'Erzincan', 'invoicing' ), | |
| 1236 | + 'TR25' => __( 'Erzurum', 'invoicing' ), | |
| 1237 | + 'TR26' => __( 'Eskişehir', 'invoicing' ), | |
| 1238 | + 'TR27' => __( 'Gaziantep', 'invoicing' ), | |
| 1239 | + 'TR28' => __( 'Giresun', 'invoicing' ), | |
| 1240 | + 'TR29' => __( 'Gümüşhane', 'invoicing' ), | |
| 1241 | + 'TR30' => __( 'Hakkari', 'invoicing' ), | |
| 1242 | + 'TR31' => __( 'Hatay', 'invoicing' ), | |
| 1243 | + 'TR32' => __( 'Isparta', 'invoicing' ), | |
| 1244 | + 'TR33' => __( 'İçel', 'invoicing' ), | |
| 1245 | + 'TR34' => __( 'İstanbul', 'invoicing' ), | |
| 1246 | + 'TR35' => __( 'İzmir', 'invoicing' ), | |
| 1247 | + 'TR36' => __( 'Kars', 'invoicing' ), | |
| 1248 | + 'TR37' => __( 'Kastamonu', 'invoicing' ), | |
| 1249 | + 'TR38' => __( 'Kayseri', 'invoicing' ), | |
| 1250 | + 'TR39' => __( 'Kırklareli', 'invoicing' ), | |
| 1251 | + 'TR40' => __( 'Kırşehir', 'invoicing' ), | |
| 1252 | + 'TR41' => __( 'Kocaeli', 'invoicing' ), | |
| 1253 | + 'TR42' => __( 'Konya', 'invoicing' ), | |
| 1254 | + 'TR43' => __( 'Kütahya', 'invoicing' ), | |
| 1255 | + 'TR44' => __( 'Malatya', 'invoicing' ), | |
| 1256 | + 'TR45' => __( 'Manisa', 'invoicing' ), | |
| 1257 | + 'TR46' => __( 'Kahramanmaraş', 'invoicing' ), | |
| 1258 | + 'TR47' => __( 'Mardin', 'invoicing' ), | |
| 1259 | + 'TR48' => __( 'Muğla', 'invoicing' ), | |
| 1260 | + 'TR49' => __( 'Muş', 'invoicing' ), | |
| 1261 | + 'TR50' => __( 'Nevşehir', 'invoicing' ), | |
| 1262 | + 'TR51' => __( 'Niğde', 'invoicing' ), | |
| 1263 | + 'TR52' => __( 'Ordu', 'invoicing' ), | |
| 1264 | + 'TR53' => __( 'Rize', 'invoicing' ), | |
| 1265 | + 'TR54' => __( 'Sakarya', 'invoicing' ), | |
| 1266 | + 'TR55' => __( 'Samsun', 'invoicing' ), | |
| 1267 | + 'TR56' => __( 'Siirt', 'invoicing' ), | |
| 1268 | + 'TR57' => __( 'Sinop', 'invoicing' ), | |
| 1269 | + 'TR58' => __( 'Sivas', 'invoicing' ), | |
| 1270 | + 'TR59' => __( 'Tekirdağ', 'invoicing' ), | |
| 1271 | + 'TR60' => __( 'Tokat', 'invoicing' ), | |
| 1272 | + 'TR61' => __( 'Trabzon', 'invoicing' ), | |
| 1273 | + 'TR62' => __( 'Tunceli', 'invoicing' ), | |
| 1274 | + 'TR63' => __( 'Şanlıurfa', 'invoicing' ), | |
| 1275 | + 'TR64' => __( 'Uşak', 'invoicing' ), | |
| 1276 | + 'TR65' => __( 'Van', 'invoicing' ), | |
| 1277 | + 'TR66' => __( 'Yozgat', 'invoicing' ), | |
| 1278 | + 'TR67' => __( 'Zonguldak', 'invoicing' ), | |
| 1279 | + 'TR68' => __( 'Aksaray', 'invoicing' ), | |
| 1280 | + 'TR69' => __( 'Bayburt', 'invoicing' ), | |
| 1281 | + 'TR70' => __( 'Karaman', 'invoicing' ), | |
| 1282 | + 'TR71' => __( 'Kırıkkale', 'invoicing' ), | |
| 1283 | + 'TR72' => __( 'Batman', 'invoicing' ), | |
| 1284 | + 'TR73' => __( 'Şırnak', 'invoicing' ), | |
| 1285 | + 'TR74' => __( 'Bartın', 'invoicing' ), | |
| 1286 | + 'TR75' => __( 'Ardahan', 'invoicing' ), | |
| 1287 | + 'TR76' => __( 'Iğdır', 'invoicing' ), | |
| 1288 | + 'TR77' => __( 'Yalova', 'invoicing' ), | |
| 1289 | + 'TR78' => __( 'Karabük', 'invoicing' ), | |
| 1290 | + 'TR79' => __( 'Kilis', 'invoicing' ), | |
| 1291 | + 'TR80' => __( 'Osmaniye', 'invoicing' ), | |
| 1292 | + 'TR81' => __( 'Düzce', 'invoicing' ), | |
| 1293 | + ), | |
| 1294 | + 'TZ' => array( // Tanzania States. | |
| 1295 | + 'TZ01' => __( 'Arusha', 'invoicing' ), | |
| 1296 | + 'TZ02' => __( 'Dar es Salaam', 'invoicing' ), | |
| 1297 | + 'TZ03' => __( 'Dodoma', 'invoicing' ), | |
| 1298 | + 'TZ04' => __( 'Iringa', 'invoicing' ), | |
| 1299 | + 'TZ05' => __( 'Kagera', 'invoicing' ), | |
| 1300 | + 'TZ06' => __( 'Pemba North', 'invoicing' ), | |
| 1301 | + 'TZ07' => __( 'Zanzibar North', 'invoicing' ), | |
| 1302 | + 'TZ08' => __( 'Kigoma', 'invoicing' ), | |
| 1303 | + 'TZ09' => __( 'Kilimanjaro', 'invoicing' ), | |
| 1304 | + 'TZ10' => __( 'Pemba South', 'invoicing' ), | |
| 1305 | + 'TZ11' => __( 'Zanzibar South', 'invoicing' ), | |
| 1306 | + 'TZ12' => __( 'Lindi', 'invoicing' ), | |
| 1307 | + 'TZ13' => __( 'Mara', 'invoicing' ), | |
| 1308 | + 'TZ14' => __( 'Mbeya', 'invoicing' ), | |
| 1309 | + 'TZ15' => __( 'Zanzibar West', 'invoicing' ), | |
| 1310 | + 'TZ16' => __( 'Morogoro', 'invoicing' ), | |
| 1311 | + 'TZ17' => __( 'Mtwara', 'invoicing' ), | |
| 1312 | + 'TZ18' => __( 'Mwanza', 'invoicing' ), | |
| 1313 | + 'TZ19' => __( 'Coast', 'invoicing' ), | |
| 1314 | + 'TZ20' => __( 'Rukwa', 'invoicing' ), | |
| 1315 | + 'TZ21' => __( 'Ruvuma', 'invoicing' ), | |
| 1316 | + 'TZ22' => __( 'Shinyanga', 'invoicing' ), | |
| 1317 | + 'TZ23' => __( 'Singida', 'invoicing' ), | |
| 1318 | + 'TZ24' => __( 'Tabora', 'invoicing' ), | |
| 1319 | + 'TZ25' => __( 'Tanga', 'invoicing' ), | |
| 1320 | + 'TZ26' => __( 'Manyara', 'invoicing' ), | |
| 1321 | + 'TZ27' => __( 'Geita', 'invoicing' ), | |
| 1322 | + 'TZ28' => __( 'Katavi', 'invoicing' ), | |
| 1323 | + 'TZ29' => __( 'Njombe', 'invoicing' ), | |
| 1324 | + 'TZ30' => __( 'Simiyu', 'invoicing' ), | |
| 1325 | + ), | |
| 1326 | + 'LK' => array(), | |
| 1327 | + 'SE' => array(), | |
| 1328 | + 'UG' => array( // Uganda districts. Ref: https://en.wikipedia.org/wiki/ISO_3166-2:UG. | |
| 1329 | + 'UG314' => __( 'Abim', 'invoicing' ), | |
| 1330 | + 'UG301' => __( 'Adjumani', 'invoicing' ), | |
| 1331 | + 'UG322' => __( 'Agago', 'invoicing' ), | |
| 1332 | + 'UG323' => __( 'Alebtong', 'invoicing' ), | |
| 1333 | + 'UG315' => __( 'Amolatar', 'invoicing' ), | |
| 1334 | + 'UG324' => __( 'Amudat', 'invoicing' ), | |
| 1335 | + 'UG216' => __( 'Amuria', 'invoicing' ), | |
| 1336 | + 'UG316' => __( 'Amuru', 'invoicing' ), | |
| 1337 | + 'UG302' => __( 'Apac', 'invoicing' ), | |
| 1338 | + 'UG303' => __( 'Arua', 'invoicing' ), | |
| 1339 | + 'UG217' => __( 'Budaka', 'invoicing' ), | |
| 1340 | + 'UG218' => __( 'Bududa', 'invoicing' ), | |
| 1341 | + 'UG201' => __( 'Bugiri', 'invoicing' ), | |
| 1342 | + 'UG235' => __( 'Bugweri', 'invoicing' ), | |
| 1343 | + 'UG420' => __( 'Buhweju', 'invoicing' ), | |
| 1344 | + 'UG117' => __( 'Buikwe', 'invoicing' ), | |
| 1345 | + 'UG219' => __( 'Bukedea', 'invoicing' ), | |
| 1346 | + 'UG118' => __( 'Bukomansimbi', 'invoicing' ), | |
| 1347 | + 'UG220' => __( 'Bukwa', 'invoicing' ), | |
| 1348 | + 'UG225' => __( 'Bulambuli', 'invoicing' ), | |
| 1349 | + 'UG416' => __( 'Buliisa', 'invoicing' ), | |
| 1350 | + 'UG401' => __( 'Bundibugyo', 'invoicing' ), | |
| 1351 | + 'UG430' => __( 'Bunyangabu', 'invoicing' ), | |
| 1352 | + 'UG402' => __( 'Bushenyi', 'invoicing' ), | |
| 1353 | + 'UG202' => __( 'Busia', 'invoicing' ), | |
| 1354 | + 'UG221' => __( 'Butaleja', 'invoicing' ), | |
| 1355 | + 'UG119' => __( 'Butambala', 'invoicing' ), | |
| 1356 | + 'UG233' => __( 'Butebo', 'invoicing' ), | |
| 1357 | + 'UG120' => __( 'Buvuma', 'invoicing' ), | |
| 1358 | + 'UG226' => __( 'Buyende', 'invoicing' ), | |
| 1359 | + 'UG317' => __( 'Dokolo', 'invoicing' ), | |
| 1360 | + 'UG121' => __( 'Gomba', 'invoicing' ), | |
| 1361 | + 'UG304' => __( 'Gulu', 'invoicing' ), | |
| 1362 | + 'UG403' => __( 'Hoima', 'invoicing' ), | |
| 1363 | + 'UG417' => __( 'Ibanda', 'invoicing' ), | |
| 1364 | + 'UG203' => __( 'Iganga', 'invoicing' ), | |
| 1365 | + 'UG418' => __( 'Isingiro', 'invoicing' ), | |
| 1366 | + 'UG204' => __( 'Jinja', 'invoicing' ), | |
| 1367 | + 'UG318' => __( 'Kaabong', 'invoicing' ), | |
| 1368 | + 'UG404' => __( 'Kabale', 'invoicing' ), | |
| 1369 | + 'UG405' => __( 'Kabarole', 'invoicing' ), | |
| 1370 | + 'UG213' => __( 'Kaberamaido', 'invoicing' ), | |
| 1371 | + 'UG427' => __( 'Kagadi', 'invoicing' ), | |
| 1372 | + 'UG428' => __( 'Kakumiro', 'invoicing' ), | |
| 1373 | + 'UG101' => __( 'Kalangala', 'invoicing' ), | |
| 1374 | + 'UG222' => __( 'Kaliro', 'invoicing' ), | |
| 1375 | + 'UG122' => __( 'Kalungu', 'invoicing' ), | |
| 1376 | + 'UG102' => __( 'Kampala', 'invoicing' ), | |
| 1377 | + 'UG205' => __( 'Kamuli', 'invoicing' ), | |
| 1378 | + 'UG413' => __( 'Kamwenge', 'invoicing' ), | |
| 1379 | + 'UG414' => __( 'Kanungu', 'invoicing' ), | |
| 1380 | + 'UG206' => __( 'Kapchorwa', 'invoicing' ), | |
| 1381 | + 'UG236' => __( 'Kapelebyong', 'invoicing' ), | |
| 1382 | + 'UG126' => __( 'Kasanda', 'invoicing' ), | |
| 1383 | + 'UG406' => __( 'Kasese', 'invoicing' ), | |
| 1384 | + 'UG207' => __( 'Katakwi', 'invoicing' ), | |
| 1385 | + 'UG112' => __( 'Kayunga', 'invoicing' ), | |
| 1386 | + 'UG407' => __( 'Kibaale', 'invoicing' ), | |
| 1387 | + 'UG103' => __( 'Kiboga', 'invoicing' ), | |
| 1388 | + 'UG227' => __( 'Kibuku', 'invoicing' ), | |
| 1389 | + 'UG432' => __( 'Kikuube', 'invoicing' ), | |
| 1390 | + 'UG419' => __( 'Kiruhura', 'invoicing' ), | |
| 1391 | + 'UG421' => __( 'Kiryandongo', 'invoicing' ), | |
| 1392 | + 'UG408' => __( 'Kisoro', 'invoicing' ), | |
| 1393 | + 'UG305' => __( 'Kitgum', 'invoicing' ), | |
| 1394 | + 'UG319' => __( 'Koboko', 'invoicing' ), | |
| 1395 | + 'UG325' => __( 'Kole', 'invoicing' ), | |
| 1396 | + 'UG306' => __( 'Kotido', 'invoicing' ), | |
| 1397 | + 'UG208' => __( 'Kumi', 'invoicing' ), | |
| 1398 | + 'UG333' => __( 'Kwania', 'invoicing' ), | |
| 1399 | + 'UG228' => __( 'Kween', 'invoicing' ), | |
| 1400 | + 'UG123' => __( 'Kyankwanzi', 'invoicing' ), | |
| 1401 | + 'UG422' => __( 'Kyegegwa', 'invoicing' ), | |
| 1402 | + 'UG415' => __( 'Kyenjojo', 'invoicing' ), | |
| 1403 | + 'UG125' => __( 'Kyotera', 'invoicing' ), | |
| 1404 | + 'UG326' => __( 'Lamwo', 'invoicing' ), | |
| 1405 | + 'UG307' => __( 'Lira', 'invoicing' ), | |
| 1406 | + 'UG229' => __( 'Luuka', 'invoicing' ), | |
| 1407 | + 'UG104' => __( 'Luwero', 'invoicing' ), | |
| 1408 | + 'UG124' => __( 'Lwengo', 'invoicing' ), | |
| 1409 | + 'UG114' => __( 'Lyantonde', 'invoicing' ), | |
| 1410 | + 'UG223' => __( 'Manafwa', 'invoicing' ), | |
| 1411 | + 'UG320' => __( 'Maracha', 'invoicing' ), | |
| 1412 | + 'UG105' => __( 'Masaka', 'invoicing' ), | |
| 1413 | + 'UG409' => __( 'Masindi', 'invoicing' ), | |
| 1414 | + 'UG214' => __( 'Mayuge', 'invoicing' ), | |
| 1415 | + 'UG209' => __( 'Mbale', 'invoicing' ), | |
| 1416 | + 'UG410' => __( 'Mbarara', 'invoicing' ), | |
| 1417 | + 'UG423' => __( 'Mitooma', 'invoicing' ), | |
| 1418 | + 'UG115' => __( 'Mityana', 'invoicing' ), | |
| 1419 | + 'UG308' => __( 'Moroto', 'invoicing' ), | |
| 1420 | + 'UG309' => __( 'Moyo', 'invoicing' ), | |
| 1421 | + 'UG106' => __( 'Mpigi', 'invoicing' ), | |
| 1422 | + 'UG107' => __( 'Mubende', 'invoicing' ), | |
| 1423 | + 'UG108' => __( 'Mukono', 'invoicing' ), | |
| 1424 | + 'UG334' => __( 'Nabilatuk', 'invoicing' ), | |
| 1425 | + 'UG311' => __( 'Nakapiripirit', 'invoicing' ), | |
| 1426 | + 'UG116' => __( 'Nakaseke', 'invoicing' ), | |
| 1427 | + 'UG109' => __( 'Nakasongola', 'invoicing' ), | |
| 1428 | + 'UG230' => __( 'Namayingo', 'invoicing' ), | |
| 1429 | + 'UG234' => __( 'Namisindwa', 'invoicing' ), | |
| 1430 | + 'UG224' => __( 'Namutumba', 'invoicing' ), | |
| 1431 | + 'UG327' => __( 'Napak', 'invoicing' ), | |
| 1432 | + 'UG310' => __( 'Nebbi', 'invoicing' ), | |
| 1433 | + 'UG231' => __( 'Ngora', 'invoicing' ), | |
| 1434 | + 'UG424' => __( 'Ntoroko', 'invoicing' ), | |
| 1435 | + 'UG411' => __( 'Ntungamo', 'invoicing' ), | |
| 1436 | + 'UG328' => __( 'Nwoya', 'invoicing' ), | |
| 1437 | + 'UG331' => __( 'Omoro', 'invoicing' ), | |
| 1438 | + 'UG329' => __( 'Otuke', 'invoicing' ), | |
| 1439 | + 'UG321' => __( 'Oyam', 'invoicing' ), | |
| 1440 | + 'UG312' => __( 'Pader', 'invoicing' ), | |
| 1441 | + 'UG332' => __( 'Pakwach', 'invoicing' ), | |
| 1442 | + 'UG210' => __( 'Pallisa', 'invoicing' ), | |
| 1443 | + 'UG110' => __( 'Rakai', 'invoicing' ), | |
| 1444 | + 'UG429' => __( 'Rubanda', 'invoicing' ), | |
| 1445 | + 'UG425' => __( 'Rubirizi', 'invoicing' ), | |
| 1446 | + 'UG431' => __( 'Rukiga', 'invoicing' ), | |
| 1447 | + 'UG412' => __( 'Rukungiri', 'invoicing' ), | |
| 1448 | + 'UG111' => __( 'Sembabule', 'invoicing' ), | |
| 1449 | + 'UG232' => __( 'Serere', 'invoicing' ), | |
| 1450 | + 'UG426' => __( 'Sheema', 'invoicing' ), | |
| 1451 | + 'UG215' => __( 'Sironko', 'invoicing' ), | |
| 1452 | + 'UG211' => __( 'Soroti', 'invoicing' ), | |
| 1453 | + 'UG212' => __( 'Tororo', 'invoicing' ), | |
| 1454 | + 'UG113' => __( 'Wakiso', 'invoicing' ), | |
| 1455 | + 'UG313' => __( 'Yumbe', 'invoicing' ), | |
| 1456 | + 'UG330' => __( 'Zombo', 'invoicing' ), | |
| 1457 | + ), | |
| 1458 | + 'UM' => array( | |
| 1459 | + '81' => __( 'Baker Island', 'invoicing' ), | |
| 1460 | + '84' => __( 'Howland Island', 'invoicing' ), | |
| 1461 | + '86' => __( 'Jarvis Island', 'invoicing' ), | |
| 1462 | + '67' => __( 'Johnston Atoll', 'invoicing' ), | |
| 1463 | + '89' => __( 'Kingman Reef', 'invoicing' ), | |
| 1464 | + '71' => __( 'Midway Atoll', 'invoicing' ), | |
| 1465 | + '76' => __( 'Navassa Island', 'invoicing' ), | |
| 1466 | + '95' => __( 'Palmyra Atoll', 'invoicing' ), | |
| 1467 | + '79' => __( 'Wake Island', 'invoicing' ), | |
| 1468 | + ), | |
| 1469 | + 'US' => array( // United States. | |
| 1470 | + 'AL' => __( 'Alabama', 'invoicing' ), | |
| 1471 | + 'AK' => __( 'Alaska', 'invoicing' ), | |
| 1472 | + 'AZ' => __( 'Arizona', 'invoicing' ), | |
| 1473 | + 'AR' => __( 'Arkansas', 'invoicing' ), | |
| 1474 | + 'CA' => __( 'California', 'invoicing' ), | |
| 1475 | + 'CO' => __( 'Colorado', 'invoicing' ), | |
| 1476 | + 'CT' => __( 'Connecticut', 'invoicing' ), | |
| 1477 | + 'DE' => __( 'Delaware', 'invoicing' ), | |
| 1478 | + 'DC' => __( 'District Of Columbia', 'invoicing' ), | |
| 1479 | + 'FL' => __( 'Florida', 'invoicing' ), | |
| 1480 | + 'GA' => _x( 'Georgia', 'US state of Georgia', 'invoicing' ), | |
| 1481 | + 'HI' => __( 'Hawaii', 'invoicing' ), | |
| 1482 | + 'ID' => __( 'Idaho', 'invoicing' ), | |
| 1483 | + 'IL' => __( 'Illinois', 'invoicing' ), | |
| 1484 | + 'IN' => __( 'Indiana', 'invoicing' ), | |
| 1485 | + 'IA' => __( 'Iowa', 'invoicing' ), | |
| 1486 | + 'KS' => __( 'Kansas', 'invoicing' ), | |
| 1487 | + 'KY' => __( 'Kentucky', 'invoicing' ), | |
| 1488 | + 'LA' => __( 'Louisiana', 'invoicing' ), | |
| 1489 | + 'ME' => __( 'Maine', 'invoicing' ), | |
| 1490 | + 'MD' => __( 'Maryland', 'invoicing' ), | |
| 1491 | + 'MA' => __( 'Massachusetts', 'invoicing' ), | |
| 1492 | + 'MI' => __( 'Michigan', 'invoicing' ), | |
| 1493 | + 'MN' => __( 'Minnesota', 'invoicing' ), | |
| 1494 | + 'MS' => __( 'Mississippi', 'invoicing' ), | |
| 1495 | + 'MO' => __( 'Missouri', 'invoicing' ), | |
| 1496 | + 'MT' => __( 'Montana', 'invoicing' ), | |
| 1497 | + 'NE' => __( 'Nebraska', 'invoicing' ), | |
| 1498 | + 'NV' => __( 'Nevada', 'invoicing' ), | |
| 1499 | + 'NH' => __( 'New Hampshire', 'invoicing' ), | |
| 1500 | + 'NJ' => __( 'New Jersey', 'invoicing' ), | |
| 1501 | + 'NM' => __( 'New Mexico', 'invoicing' ), | |
| 1502 | + 'NY' => __( 'New York', 'invoicing' ), | |
| 1503 | + 'NC' => __( 'North Carolina', 'invoicing' ), | |
| 1504 | + 'ND' => __( 'North Dakota', 'invoicing' ), | |
| 1505 | + 'OH' => __( 'Ohio', 'invoicing' ), | |
| 1506 | + 'OK' => __( 'Oklahoma', 'invoicing' ), | |
| 1507 | + 'OR' => __( 'Oregon', 'invoicing' ), | |
| 1508 | + 'PA' => __( 'Pennsylvania', 'invoicing' ), | |
| 1509 | + 'RI' => __( 'Rhode Island', 'invoicing' ), | |
| 1510 | + 'SC' => __( 'South Carolina', 'invoicing' ), | |
| 1511 | + 'SD' => __( 'South Dakota', 'invoicing' ), | |
| 1512 | + 'TN' => __( 'Tennessee', 'invoicing' ), | |
| 1513 | + 'TX' => __( 'Texas', 'invoicing' ), | |
| 1514 | + 'UT' => __( 'Utah', 'invoicing' ), | |
| 1515 | + 'VT' => __( 'Vermont', 'invoicing' ), | |
| 1516 | + 'VA' => __( 'Virginia', 'invoicing' ), | |
| 1517 | + 'WA' => __( 'Washington', 'invoicing' ), | |
| 1518 | + 'WV' => __( 'West Virginia', 'invoicing' ), | |
| 1519 | + 'WI' => __( 'Wisconsin', 'invoicing' ), | |
| 1520 | + 'WY' => __( 'Wyoming', 'invoicing' ), | |
| 1521 | + 'AA' => __( 'Armed Forces (AA)', 'invoicing' ), | |
| 1522 | + 'AE' => __( 'Armed Forces (AE)', 'invoicing' ), | |
| 1523 | + 'AP' => __( 'Armed Forces (AP)', 'invoicing' ), | |
| 1524 | + ), | |
| 1525 | + 'VN' => array(), | |
| 1526 | + 'YT' => array(), | |
| 1527 | + 'ZA' => array( // South African states. | |
| 1528 | + 'EC' => __( 'Eastern Cape', 'invoicing' ), | |
| 1529 | + 'FS' => __( 'Free State', 'invoicing' ), | |
| 1530 | + 'GP' => __( 'Gauteng', 'invoicing' ), | |
| 1531 | + 'KZN' => __( 'KwaZulu-Natal', 'invoicing' ), | |
| 1532 | + 'LP' => __( 'Limpopo', 'invoicing' ), | |
| 1533 | + 'MP' => __( 'Mpumalanga', 'invoicing' ), | |
| 1534 | + 'NC' => __( 'Northern Cape', 'invoicing' ), | |
| 1535 | + 'NW' => __( 'North West', 'invoicing' ), | |
| 1536 | + 'WC' => __( 'Western Cape', 'invoicing' ), | |
| 1537 | + ), | |
| 1538 | + 'ZM' => array( // Zambia's Provinces. Ref: https://en.wikipedia.org/wiki/ISO_3166-2:ZM. | |
| 1539 | + 'ZM-01' => __( 'Western', 'invoicing' ), | |
| 1540 | + 'ZM-02' => __( 'Central', 'invoicing' ), | |
| 1541 | + 'ZM-03' => __( 'Eastern', 'invoicing' ), | |
| 1542 | + 'ZM-04' => __( 'Luapula', 'invoicing' ), | |
| 1543 | + 'ZM-05' => __( 'Northern', 'invoicing' ), | |
| 1544 | + 'ZM-06' => __( 'North-Western', 'invoicing' ), | |
| 1545 | + 'ZM-07' => __( 'Southern', 'invoicing' ), | |
| 1546 | + 'ZM-08' => __( 'Copperbelt', 'invoicing' ), | |
| 1547 | + 'ZM-09' => __( 'Lusaka', 'invoicing' ), | |
| 1548 | + 'ZM-10' => __( 'Muchinga', 'invoicing' ), | |
| 1549 | + ), | |
| 1550 | 1550 | ); |