Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_shortcode('countriesDropdown', 'countriesDropdown_shortcode');
- function countriesDropdown_shortcode( $atts = [], $content = null) {
- ?>
- <div>
- <form action="#" method="post">
- <select name="countrySel" id="_countryDropdown" onchange="this.form.submit()">
- <option value="" selected disabled hidden>Select Country</option>
- <?php
- Global $countries2;
- $listOfCountries = array_keys($countries2);
- sort($listOfCountries);
- foreach( $listOfCountries as $country ) { ?>
- <option value="<?php echo $country; ?>"><?php echo $country; ?></option>
- <?php
- }
- ?>
- </select>
- </form>
- </div>
- <?php
- return '';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement