Skip to content

Instantly share code, notes, and snippets.

@gwin
Created March 29, 2015 09:08
Show Gist options
  • Save gwin/27fd97253bc9b160b8ca to your computer and use it in GitHub Desktop.
Save gwin/27fd97253bc9b160b8ca to your computer and use it in GitHub Desktop.
Add new currency
<?php
// The code below you can paste in your theme functions.php or create
// new plugin and paste the code there.
add_filter("adverts_currency_list", "add_adverts_currency");
/**
* Add new currency to the list
*
* @var $list Array list of currencies
* @return Array updated list of currencies
*/
function add_adverts_currency($list) {
$list[] = array(
"code"=>"BWP", // ISO 4217 currency code, see http://en.wikipedia.org/wiki/ISO_4217
"sign"=>"Pula", // currency prefix or postfix
"label"=>"Botswana pula" // currency long name
);
return $list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment