Beschrijving
To use the WP Country plugin in your theme or plugin add global $wp_country; into your theme or plugin PHP file,
then:
-
$wp_country->countries_list()is an array of country names -
$wp_country->dropdown()prints or returns countries as dropdown HTML tag. -
$wp_country->name($alpha2)returns the name of a country by it’s 2-character code.
Russian translation is available now.
Installatie
- Upload the
wp-countryfolder to the/wp-content/plugins/directory. - Activate the plugin.
FAQ
Advanced usage: dropdown($blank, $echo, $args)
- Parameters Description
-
-
blank: if not empty then
<option value=''>will be added into dropdown list. Default: ”. -
echo: prints the list if true else returns. Default: true.
-
args: an array of extra parameters. Default:
array('include' => array(), 'exclude' => array(), 'name' => 'country', 'id' => '', 'selected' => array(), 'multiple' => false).
-
- Description of `args` components
-
-
include, exclude: an array of country codes (alpha2) should be included into dropdown list or excluded from it.
-
name:
nameattribute of the SELECT tag. -
id:
idattribute (not displayed by default). -
class:
classattribute of the SELECT tag (empty by default). -
multiple: enables multiple select.
-
selected: adds the
selectedattribute.
-
Beoordelingen
Er zijn geen beoordelingen voor deze plugin.
Bijdragers & ontwikkelaars
“WP Country” is open source software. De volgende personen hebben bijgedragen aan deze plugin.
BijdragersVertaal “WP Country” naar jouw taal.
Interesse in de ontwikkeling?
Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.
Changelog
- 0.2 Add
classparameter for dropdown list. - 0.1 Initial version.