PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
wp-google-maps
/
includes
<?php namespace WPGMZA; class CountrySelect extends DOMDocument { private static $cachedJson; public function __construct($options=null) { if(empty(CountrySelect::$cachedJson)) { $str = file_get_contents( plugin_dir_path(WPGMZA_FILE) . 'js/countries.json' ); $json = json_decode($str); CountrySelect::$cachedJson = $json; } DOMDocument::__construct(); if(!$options) $options = array(); $this->loadHTML('<select></select>'); $select = $this->querySelector('select'); if(!empty($options['name'])) $select->setAttribute('name', $options['name']); $option = $this->createElement('option'); $option->setAttribute('value', ''); $option->appendText(__('Please select','wp-google-maps')); $select->appendChild($option); foreach(CountrySelect::$cachedJson as $country) { $code = false; if(!empty($country->alpha2Code)){ /* We have the alpha 2 code, which will work far more consistently */ $code = strtolower($country->alpha2Code); } else { if(!empty($country->topLevelDomain[0])){ /* Fallback to the TLD */ $code = str_replace('.', '', $country->topLevelDomain[0]); } } if(empty($code)){ continue; } $name = $country->name; $option = $this->createElement('option'); $option->setAttribute('value', $code); $option->appendText($name); if(!empty($code) && !empty($options['value']) && $code == $options['value']){ $option->setAttribute("selected", "selected"); } $select->appendChild($option); } /* Developer Hook (Action) - Alter the country select output, passes DOMElement for mutation */ do_action("wpgmza_country_select_created", $select); } }
[-] class.admin-ui.php
[edit]
[+]
3rd-party-integration
[-] class.latlng.php
[edit]
[-] class.map.php
[edit]
[-] class.admin-notices.php
[edit]
[-] class.dom-query-results.php
[edit]
[-] class.pointlabel.php
[edit]
[-] class.upgrader.php
[edit]
[-] class.map-list-page.php
[edit]
[-] class.integrity-checker.php
[edit]
[-] class.dom-document.php
[edit]
[-] class.crud.php
[edit]
[+]
styling
[-] class.dynamic-translations.php
[edit]
[-] class.strings.php
[edit]
[-] class.library-script-panel.php
[edit]
[+]
open-layers
[-] class.maps-engine-dialog.php
[edit]
[+]
compat
[-] class.plugin.php
[edit]
[-] class.theme-panel.php
[edit]
[-] class.global-settings.php
[edit]
[+]
google-maps
[-] class.query.php
[edit]
[-] class.modal-dialog.php
[edit]
[-] class.script-loader.php
[edit]
[-] class.internal-engine.php
[edit]
[-] class.selector-to-xpath.php
[edit]
[-] class.polygon.php
[edit]
[-] class.rectangle.php
[edit]
[-] class.system-info.php
[edit]
[-] class.shortcodes.php
[edit]
[-] class.gdpr-compliance.php
[edit]
[+]
php8
[-] build.log
[edit]
[+]
tables
[-] class.polyline.php
[edit]
[-] class.settings.php
[edit]
[-] class.store-locator.php
[edit]
[-] class.country-select.php
[edit]
[-] class.settings-page.php
[edit]
[-] class.dom-element.php
[edit]
[+]
..
[-] class.elias-fano.php
[edit]
[-] class.distance.php
[edit]
[-] class.auto-loader.php
[edit]
[-] class.circle.php
[edit]
[-] class.page.php
[edit]
[-] class.component-anchor-control.php
[edit]
[+]
map-edit-page
[-] class.feature.php
[edit]
[-] class.marker.php
[edit]
[-] class.database.php
[edit]
[-] class.marker-filter.php
[edit]
[-] class.google-maps-api-loader.php
[edit]
[-] class.factory.php
[edit]
[+]
legacy
[-] class.installer-page.php
[edit]
[-] class.query-fragment.php
[edit]