Changeset 1396966
- Timestamp:
- 04/16/2016 12:27:21 AM (10 years ago)
- Location:
- wp-country/trunk
- Files:
-
- 2 edited
-
country.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-country/trunk/country.php
r829314 r1396966 5 5 Description: Provides WP_Country PHP class to get countries list as an array and dropdown country select for use in other plugins and themes. 6 6 Author: Andrey K. 7 Version: 0. 17 Version: 0.2 8 8 Author URI: http://andrey.eto-ya.com/ 9 9 */ … … 286 286 'name' => 'country', 287 287 'id' => '', 288 'class' => '', 288 289 'selected' => array(), 289 290 'multiple' => false, … … 324 325 325 326 if ($arr) { 326 $out .= '<select name="' . $name . ($multiple? '[]" multiple ="multiple" ': '"')327 . ($id ? ' id="' . $id . '"' : '') . '>';327 $out .= '<select name="' . $name . ($multiple? '[]" multiple ': '"') 328 . ($id ? ' id="' . $id . '" ' : '') . ($class ? ' class="' . $class . '"' : '') . '>'; 328 329 foreach ($arr as $key => $value) { 329 $out .= '<option value="' . $key. '"' . (in_array($key, $selected) ? ' selected="selected" ' : '') .'>' . $value . '</option>';330 $out .= '<option value="' . $key. '"' . (in_array($key, $selected) ? ' selected' : '') . '>' . $value . '</option>'; 330 331 } 331 332 $out .= '</select>'; -
wp-country/trunk/readme.txt
r829317 r1396966 5 5 Plugin URI: http://andrey.eto-ya.com/wp-country-plugin 6 6 Requires at least: 3.6 7 Tested up to: 3.88 Stable tag: 3.67 Tested up to: 4.5 8 Stable tag: 0.2 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 45 45 * *id*: `id` attribute (not displayed by default). 46 46 47 * *class*: `class` attribute of the SELECT tag (empty by default). 48 47 49 * *multiple*: enables multiple select. 48 50 49 51 * *selected*: adds the `selected` attribute. 50 51 52 52 53 == Installation == … … 57 58 == Changelog == 58 59 60 * 0.2 Add `class` parameter for dropdown list. 59 61 * 0.1 Initial version. 60
Note: See TracChangeset
for help on using the changeset viewer.