| Conditions | 1 |
| Paths | 1 |
| Total Lines | 790 |
| Code Lines | 619 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 67 | function give_get_currencies_list() { |
||
| 68 | $currencies = array( |
||
| 69 | 'USD' => array( |
||
| 70 | 'admin_label' => __( 'US Dollars ($)', 'give' ), |
||
| 71 | 'symbol' => '$', |
||
| 72 | 'setting' => array( |
||
| 73 | 'currency_position' => 'before', |
||
| 74 | 'thousands_separator' => ',', |
||
| 75 | 'decimal_separator' => '.', |
||
| 76 | 'number_decimals' => 2, |
||
| 77 | ), |
||
| 78 | ), |
||
| 79 | 'EUR' => array( |
||
| 80 | 'admin_label' => __( 'Euros (€)', 'give' ), |
||
| 81 | 'symbol' => '€', |
||
| 82 | 'setting' => array( |
||
| 83 | 'currency_position' => 'before', |
||
| 84 | 'thousands_separator' => '.', |
||
| 85 | 'decimal_separator' => ',', |
||
| 86 | 'number_decimals' => 2, |
||
| 87 | ), |
||
| 88 | ), |
||
| 89 | 'GBP' => array( |
||
| 90 | 'admin_label' => __( 'Pounds Sterling (£)', 'give' ), |
||
| 91 | 'symbol' => '£', |
||
| 92 | 'setting' => array( |
||
| 93 | 'currency_position' => 'before', |
||
| 94 | 'thousands_separator' => ',', |
||
| 95 | 'decimal_separator' => '.', |
||
| 96 | 'number_decimals' => 2, |
||
| 97 | ), |
||
| 98 | ), |
||
| 99 | 'AUD' => array( |
||
| 100 | 'admin_label' => __( 'Australian Dollars ($)', 'give' ), |
||
| 101 | 'symbol' => '$', |
||
| 102 | 'setting' => array( |
||
| 103 | 'currency_position' => 'before', |
||
| 104 | 'thousands_separator' => ',', |
||
| 105 | 'decimal_separator' => '.', |
||
| 106 | 'number_decimals' => 2, |
||
| 107 | ), |
||
| 108 | ), |
||
| 109 | 'BRL' => array( |
||
| 110 | 'admin_label' => __( 'Brazilian Real (R$)', 'give' ), |
||
| 111 | 'symbol' => 'R$', |
||
| 112 | 'setting' => array( |
||
| 113 | 'currency_position' => 'before', |
||
| 114 | 'thousands_separator' => ',', |
||
| 115 | 'decimal_separator' => '.', |
||
| 116 | 'number_decimals' => 2, |
||
| 117 | ), |
||
| 118 | ), |
||
| 119 | 'CAD' => array( |
||
| 120 | 'admin_label' => __( 'Canadian Dollars ($)', 'give' ), |
||
| 121 | 'symbol' => '$', |
||
| 122 | 'setting' => array( |
||
| 123 | 'currency_position' => 'before', |
||
| 124 | 'thousands_separator' => ',', |
||
| 125 | 'decimal_separator' => '.', |
||
| 126 | 'number_decimals' => 2, |
||
| 127 | ), |
||
| 128 | ), |
||
| 129 | 'CZK' => array( |
||
| 130 | 'admin_label' => __( 'Czech Koruna (Kč)', 'give' ), |
||
| 131 | 'symbol' => 'Kč', |
||
| 132 | 'setting' => array( |
||
| 133 | 'currency_position' => 'after', |
||
| 134 | 'thousands_separator' => ',', |
||
| 135 | 'decimal_separator' => '.', |
||
| 136 | 'number_decimals' => 2, |
||
| 137 | ), |
||
| 138 | ), |
||
| 139 | 'DKK' => array( |
||
| 140 | 'admin_label' => __( 'Danish Krone (kr.)', 'give' ), |
||
| 141 | 'symbol' => ' kr. ', |
||
| 142 | 'setting' => array( |
||
| 143 | 'currency_position' => 'before', |
||
| 144 | 'thousands_separator' => ',', |
||
| 145 | 'decimal_separator' => '.', |
||
| 146 | 'number_decimals' => 2, |
||
| 147 | ), |
||
| 148 | ), |
||
| 149 | 'HKD' => array( |
||
| 150 | 'admin_label' => __( 'Hong Kong Dollar ($)', 'give' ), |
||
| 151 | 'symbol' => '$', |
||
| 152 | 'setting' => array( |
||
| 153 | 'currency_position' => 'before', |
||
| 154 | 'thousands_separator' => ',', |
||
| 155 | 'decimal_separator' => '.', |
||
| 156 | 'number_decimals' => 2, |
||
| 157 | ), |
||
| 158 | ), |
||
| 159 | 'HUF' => array( |
||
| 160 | 'admin_label' => __( 'Hungarian Forint (Ft)', 'give' ), |
||
| 161 | 'symbol' => 'Ft', |
||
| 162 | 'setting' => array( |
||
| 163 | 'currency_position' => 'after', |
||
| 164 | 'thousands_separator' => ',', |
||
| 165 | 'decimal_separator' => '.', |
||
| 166 | 'number_decimals' => 2, |
||
| 167 | ), |
||
| 168 | ), |
||
| 169 | 'ILS' => array( |
||
| 170 | 'admin_label' => __( 'Israeli Shekel (₪)', 'give' ), |
||
| 171 | 'symbol' => '₪', |
||
| 172 | 'setting' => array( |
||
| 173 | 'currency_position' => 'after', |
||
| 174 | 'thousands_separator' => ',', |
||
| 175 | 'decimal_separator' => '.', |
||
| 176 | 'number_decimals' => 2, |
||
| 177 | ), |
||
| 178 | ), |
||
| 179 | 'JPY' => array( |
||
| 180 | 'admin_label' => __( 'Japanese Yen (¥)', 'give' ), |
||
| 181 | 'symbol' => '¥', |
||
| 182 | 'setting' => array( |
||
| 183 | 'currency_position' => 'before', |
||
| 184 | 'thousands_separator' => ',', |
||
| 185 | 'decimal_separator' => '.', |
||
| 186 | 'number_decimals' => 0, |
||
| 187 | ), |
||
| 188 | ), |
||
| 189 | 'MYR' => array( |
||
| 190 | 'admin_label' => __( 'Malaysian Ringgits (RM)', 'give' ), |
||
| 191 | 'symbol' => 'RM', |
||
| 192 | 'setting' => array( |
||
| 193 | 'currency_position' => 'before', |
||
| 194 | 'thousands_separator' => ',', |
||
| 195 | 'decimal_separator' => '.', |
||
| 196 | 'number_decimals' => 2, |
||
| 197 | ), |
||
| 198 | ), |
||
| 199 | 'MXN' => array( |
||
| 200 | 'admin_label' => __( 'Mexican Peso ($)', 'give' ), |
||
| 201 | 'symbol' => '$', |
||
| 202 | 'setting' => array( |
||
| 203 | 'currency_position' => 'before', |
||
| 204 | 'thousands_separator' => ',', |
||
| 205 | 'decimal_separator' => '.', |
||
| 206 | 'number_decimals' => 2, |
||
| 207 | ), |
||
| 208 | ), |
||
| 209 | 'MAD' => array( |
||
| 210 | 'admin_label' => __( 'Moroccan Dirham (.د.م)', 'give' ), |
||
| 211 | 'symbol' => '.د.م', |
||
| 212 | 'setting' => array( |
||
| 213 | 'currency_position' => 'before', |
||
| 214 | 'thousands_separator' => ',', |
||
| 215 | 'decimal_separator' => '.', |
||
| 216 | 'number_decimals' => 2, |
||
| 217 | ), |
||
| 218 | ), |
||
| 219 | 'NZD' => array( |
||
| 220 | 'admin_label' => __( 'New Zealand Dollar ($)', 'give' ), |
||
| 221 | 'symbol' => '$', |
||
| 222 | 'setting' => array( |
||
| 223 | 'currency_position' => 'before', |
||
| 224 | 'thousands_separator' => ',', |
||
| 225 | 'decimal_separator' => '.', |
||
| 226 | 'number_decimals' => 2, |
||
| 227 | ), |
||
| 228 | ), |
||
| 229 | 'NOK' => array( |
||
| 230 | 'admin_label' => __( 'Norwegian Krone (Kr.)', 'give' ), |
||
| 231 | 'symbol' => 'kr.', |
||
| 232 | 'setting' => array( |
||
| 233 | 'currency_position' => 'before', |
||
| 234 | 'thousands_separator' => '.', |
||
| 235 | 'decimal_separator' => ',', |
||
| 236 | 'number_decimals' => 2, |
||
| 237 | ), |
||
| 238 | ), |
||
| 239 | 'PHP' => array( |
||
| 240 | 'admin_label' => __( 'Philippine Pesos (₱)', 'give' ), |
||
| 241 | 'symbol' => '₱', |
||
| 242 | 'setting' => array( |
||
| 243 | 'currency_position' => 'before', |
||
| 244 | 'thousands_separator' => ',', |
||
| 245 | 'decimal_separator' => '.', |
||
| 246 | 'number_decimals' => 2, |
||
| 247 | ), |
||
| 248 | ), |
||
| 249 | 'PLN' => array( |
||
| 250 | 'admin_label' => __( 'Polish Zloty (zł)', 'give' ), |
||
| 251 | 'symbol' => 'zł', |
||
| 252 | 'setting' => array( |
||
| 253 | 'currency_position' => 'after', |
||
| 254 | 'thousands_separator' => ' ', |
||
| 255 | 'decimal_separator' => ',', |
||
| 256 | 'number_decimals' => 2, |
||
| 257 | ), |
||
| 258 | ), |
||
| 259 | 'SGD' => array( |
||
| 260 | 'admin_label' => __( 'Singapore Dollar ($)', 'give' ), |
||
| 261 | 'symbol' => '$', |
||
| 262 | 'setting' => array( |
||
| 263 | 'currency_position' => 'before', |
||
| 264 | 'thousands_separator' => ',', |
||
| 265 | 'decimal_separator' => '.', |
||
| 266 | 'number_decimals' => 2, |
||
| 267 | ), |
||
| 268 | ), |
||
| 269 | 'KRW' => array( |
||
| 270 | 'admin_label' => __( 'South Korean Won (₩)', 'give' ), |
||
| 271 | 'symbol' => '₩', |
||
| 272 | 'setting' => array( |
||
| 273 | 'currency_position' => 'before', |
||
| 274 | 'thousands_separator' => ',', |
||
| 275 | 'decimal_separator' => '.', |
||
| 276 | 'number_decimals' => 0, |
||
| 277 | ), |
||
| 278 | ), |
||
| 279 | 'ZAR' => array( |
||
| 280 | 'admin_label' => __( 'South African Rand (R)', 'give' ), |
||
| 281 | 'symbol' => 'R', |
||
| 282 | 'setting' => array( |
||
| 283 | 'currency_position' => 'before', |
||
| 284 | 'thousands_separator' => ' ', |
||
| 285 | 'decimal_separator' => '.', |
||
| 286 | 'number_decimals' => 2, |
||
| 287 | ), |
||
| 288 | ), |
||
| 289 | 'SEK' => array( |
||
| 290 | 'admin_label' => __( 'Swedish Krona (kr)', 'give' ), |
||
| 291 | 'symbol' => ' kr. ', |
||
| 292 | 'setting' => array( |
||
| 293 | 'currency_position' => 'before', |
||
| 294 | 'thousands_separator' => ' ', |
||
| 295 | 'decimal_separator' => ',', |
||
| 296 | 'number_decimals' => 2, |
||
| 297 | ), |
||
| 298 | ), |
||
| 299 | 'CHF' => array( |
||
| 300 | 'admin_label' => __( 'Swiss Franc (Fr)', 'give' ), |
||
| 301 | 'symbol' => 'Fr', |
||
| 302 | 'setting' => array( |
||
| 303 | 'currency_position' => 'before', |
||
| 304 | 'thousands_separator' => ',', |
||
| 305 | 'decimal_separator' => '.', |
||
| 306 | 'number_decimals' => 2, |
||
| 307 | ), |
||
| 308 | ), |
||
| 309 | 'TWD' => array( |
||
| 310 | 'admin_label' => __( 'Taiwan New Dollars (NT$)', 'give' ), |
||
| 311 | 'symbol' => 'NT$', |
||
| 312 | 'setting' => array( |
||
| 313 | 'currency_position' => 'before', |
||
| 314 | 'thousands_separator' => '\'', |
||
| 315 | 'decimal_separator' => '.', |
||
| 316 | 'number_decimals' => 2, |
||
| 317 | ), |
||
| 318 | ), |
||
| 319 | 'THB' => array( |
||
| 320 | 'admin_label' => __( 'Thai Baht (฿)', 'give' ), |
||
| 321 | 'symbol' => '฿', |
||
| 322 | 'setting' => array( |
||
| 323 | 'currency_position' => 'before', |
||
| 324 | 'thousands_separator' => ',', |
||
| 325 | 'decimal_separator' => '.', |
||
| 326 | 'number_decimals' => 2, |
||
| 327 | ), |
||
| 328 | ), |
||
| 329 | 'INR' => array( |
||
| 330 | 'admin_label' => __( 'Indian Rupee (₹)', 'give' ), |
||
| 331 | 'symbol' => '₹', |
||
| 332 | 'setting' => array( |
||
| 333 | 'currency_position' => 'before', |
||
| 334 | 'thousands_separator' => ',', |
||
| 335 | 'decimal_separator' => '.', |
||
| 336 | 'number_decimals' => 2, |
||
| 337 | ), |
||
| 338 | ), |
||
| 339 | 'TRY' => array( |
||
| 340 | 'admin_label' => __( 'Turkish Lira (₺)', 'give' ), |
||
| 341 | 'symbol' => '₺', |
||
| 342 | 'setting' => array( |
||
| 343 | 'currency_position' => 'after', |
||
| 344 | 'thousands_separator' => ',', |
||
| 345 | 'decimal_separator' => '.', |
||
| 346 | 'number_decimals' => 2, |
||
| 347 | ), |
||
| 348 | ), |
||
| 349 | 'IRR' => array( |
||
| 350 | 'admin_label' => __( 'Iranian Rial (﷼)', 'give' ), |
||
| 351 | 'symbol' => '﷼', |
||
| 352 | 'setting' => array( |
||
| 353 | 'currency_position' => 'after', |
||
| 354 | 'thousands_separator' => ',', |
||
| 355 | 'decimal_separator' => '.', |
||
| 356 | 'number_decimals' => 2, |
||
| 357 | ), |
||
| 358 | ), |
||
| 359 | 'RUB' => array( |
||
| 360 | 'admin_label' => __( 'Russian Rubles (руб)', 'give' ), |
||
| 361 | 'symbol' => '₽', |
||
| 362 | 'setting' => array( |
||
| 363 | 'currency_position' => 'before', |
||
| 364 | 'thousands_separator' => '.', |
||
| 365 | 'decimal_separator' => ',', |
||
| 366 | 'number_decimals' => 2, |
||
| 367 | ), |
||
| 368 | ), |
||
| 369 | 'AED' => array( |
||
| 370 | 'admin_label' => __( 'United Arab Emirates dirham (د.إ)', 'give' ), |
||
| 371 | 'symbol' => 'د.إ', |
||
| 372 | 'setting' => array( |
||
| 373 | 'currency_position' => 'before', |
||
| 374 | 'thousands_separator' => ',', |
||
| 375 | 'decimal_separator' => '.', |
||
| 376 | 'number_decimals' => 2, |
||
| 377 | ), |
||
| 378 | ), |
||
| 379 | 'AMD' => array( |
||
| 380 | 'admin_label' => __( 'Armenian dram (AMD)', 'give' ), |
||
| 381 | 'symbol' => 'AMD', // Add backward compatibility. Using AMD in place of ֏ |
||
| 382 | 'setting' => array( |
||
| 383 | 'currency_position' => 'before', |
||
| 384 | 'thousands_separator' => ',', |
||
| 385 | 'decimal_separator' => '.', |
||
| 386 | 'number_decimals' => 2, |
||
| 387 | ), |
||
| 388 | ), |
||
| 389 | 'ANG' => array( |
||
| 390 | 'admin_label' => __( 'Netherlands Antillean guilder (ƒ)', 'give' ), |
||
| 391 | 'symbol' => 'ƒ', |
||
| 392 | 'setting' => array( |
||
| 393 | 'currency_position' => 'before', |
||
| 394 | 'thousands_separator' => '.', |
||
| 395 | 'decimal_separator' => ',', |
||
| 396 | 'number_decimals' => 2, |
||
| 397 | ), |
||
| 398 | ), |
||
| 399 | 'ARS' => array( |
||
| 400 | 'admin_label' => __( 'Argentine peso ($)', 'give' ), |
||
| 401 | 'symbol' => '$', |
||
| 402 | 'setting' => array( |
||
| 403 | 'currency_position' => 'before', |
||
| 404 | 'thousands_separator' => '.', |
||
| 405 | 'decimal_separator' => ',', |
||
| 406 | 'number_decimals' => 2, |
||
| 407 | ), |
||
| 408 | ), |
||
| 409 | 'AWG' => array( |
||
| 410 | 'admin_label' => __( 'Aruban florin (ƒ)', 'give' ), |
||
| 411 | 'symbol' => 'ƒ', |
||
| 412 | 'setting' => array( |
||
| 413 | 'currency_position' => 'before', |
||
| 414 | 'thousands_separator' => ',', |
||
| 415 | 'decimal_separator' => '.', |
||
| 416 | 'number_decimals' => 2, |
||
| 417 | ), |
||
| 418 | ), |
||
| 419 | 'BAM' => array( |
||
| 420 | 'admin_label' => __( 'Bosnia and Herzegovina convertible mark (KM)', 'give' ), |
||
| 421 | 'symbol' => 'KM', |
||
| 422 | 'setting' => array( |
||
| 423 | 'currency_position' => 'before', |
||
| 424 | 'thousands_separator' => ',', |
||
| 425 | 'decimal_separator' => '.', |
||
| 426 | 'number_decimals' => 2, |
||
| 427 | ), |
||
| 428 | ), |
||
| 429 | 'BDT' => array( |
||
| 430 | 'admin_label' => __( 'Bangladeshi taka (৳)', 'give' ), |
||
| 431 | 'symbol' => '৳', |
||
| 432 | 'setting' => array( |
||
| 433 | 'currency_position' => 'before', |
||
| 434 | 'thousands_separator' => ',', |
||
| 435 | 'decimal_separator' => '.', |
||
| 436 | 'number_decimals' => 2, |
||
| 437 | ), |
||
| 438 | ), |
||
| 439 | 'BHD' => array( |
||
| 440 | 'admin_label' => __( 'Bahraini dinar (.د.ب)', 'give' ), |
||
| 441 | 'symbol' => '.د.ب', |
||
| 442 | 'setting' => array( |
||
| 443 | 'currency_position' => 'before', |
||
| 444 | 'thousands_separator' => ',', |
||
| 445 | 'decimal_separator' => '.', |
||
| 446 | 'number_decimals' => 3, |
||
| 447 | ), |
||
| 448 | ), |
||
| 449 | 'BMD' => array( |
||
| 450 | 'admin_label' => __( 'Bermudian dollar (BD$)', 'give' ), |
||
| 451 | 'symbol' => 'BD$', |
||
| 452 | 'setting' => array( |
||
| 453 | 'currency_position' => 'before', |
||
| 454 | 'thousands_separator' => ',', |
||
| 455 | 'decimal_separator' => '.', |
||
| 456 | 'number_decimals' => 2, |
||
| 457 | ), |
||
| 458 | ), |
||
| 459 | 'BND' => array( |
||
| 460 | 'admin_label' => __( 'Brunei dollar (B$)', 'give' ), |
||
| 461 | 'symbol' => 'B$', |
||
| 462 | 'setting' => array( |
||
| 463 | 'currency_position' => 'before', |
||
| 464 | 'thousands_separator' => ',', |
||
| 465 | 'decimal_separator' => '.', |
||
| 466 | 'number_decimals' => 2, |
||
| 467 | ), |
||
| 468 | ), |
||
| 469 | 'BOB' => array( |
||
| 470 | 'admin_label' => __( 'Bolivian boliviano (Bs.)', 'give' ), |
||
| 471 | 'symbol' => 'Bs.', |
||
| 472 | 'setting' => array( |
||
| 473 | 'currency_position' => 'before', |
||
| 474 | 'thousands_separator' => ',', |
||
| 475 | 'decimal_separator' => '.', |
||
| 476 | 'number_decimals' => 2, |
||
| 477 | ), |
||
| 478 | ), |
||
| 479 | 'BSD' => array( |
||
| 480 | 'admin_label' => __( 'Bahamian dollar (B$)', 'give' ), |
||
| 481 | 'symbol' => 'B$', |
||
| 482 | 'setting' => array( |
||
| 483 | 'currency_position' => 'before', |
||
| 484 | 'thousands_separator' => ',', |
||
| 485 | 'decimal_separator' => '.', |
||
| 486 | 'number_decimals' => 2, |
||
| 487 | ), |
||
| 488 | ), |
||
| 489 | 'BWP' => array( |
||
| 490 | 'admin_label' => __( 'Botswana pula (P)', 'give' ), |
||
| 491 | 'symbol' => 'P', |
||
| 492 | 'setting' => array( |
||
| 493 | 'currency_position' => 'before', |
||
| 494 | 'thousands_separator' => ',', |
||
| 495 | 'decimal_separator' => '.', |
||
| 496 | 'number_decimals' => 2, |
||
| 497 | ), |
||
| 498 | ), |
||
| 499 | 'BZD' => array( |
||
| 500 | 'admin_label' => __( 'Belizean dollar (BZ$)', 'give' ), |
||
| 501 | 'symbol' => 'BZ$', |
||
| 502 | 'setting' => array( |
||
| 503 | 'currency_position' => 'before', |
||
| 504 | 'thousands_separator' => ',', |
||
| 505 | 'decimal_separator' => '.', |
||
| 506 | 'number_decimals' => 2, |
||
| 507 | ), |
||
| 508 | ), |
||
| 509 | 'CLP' => array( |
||
| 510 | 'admin_label' => __( 'Chilean peso ($)', 'give' ), |
||
| 511 | 'symbol' => '$', |
||
| 512 | 'setting' => array( |
||
| 513 | 'currency_position' => 'before', |
||
| 514 | 'thousands_separator' => '.', |
||
| 515 | 'decimal_separator' => '', |
||
| 516 | 'number_decimals' => 0, |
||
| 517 | ), |
||
| 518 | ), |
||
| 519 | 'CNY' => array( |
||
| 520 | 'admin_label' => __( 'Chinese yuan (¥)', 'give' ), |
||
| 521 | 'symbol' => '¥', |
||
| 522 | 'setting' => array( |
||
| 523 | 'currency_position' => 'before', |
||
| 524 | 'thousands_separator' => ',', |
||
| 525 | 'decimal_separator' => '.', |
||
| 526 | 'number_decimals' => 2, |
||
| 527 | ), |
||
| 528 | ), |
||
| 529 | 'COP' => array( |
||
| 530 | 'admin_label' => __( 'Colombian peso ($)', 'give' ), |
||
| 531 | 'symbol' => '$', |
||
| 532 | 'setting' => array( |
||
| 533 | 'currency_position' => 'before', |
||
| 534 | 'thousands_separator' => '.', |
||
| 535 | 'decimal_separator' => ',', |
||
| 536 | 'number_decimals' => 2, |
||
| 537 | ), |
||
| 538 | ), |
||
| 539 | 'CRC' => array( |
||
| 540 | 'admin_label' => __( 'Costa Rican colón (₡)', 'give' ), |
||
| 541 | 'symbol' => '₡', |
||
| 542 | 'setting' => array( |
||
| 543 | 'currency_position' => 'before', |
||
| 544 | 'thousands_separator' => '.', |
||
| 545 | 'decimal_separator' => ',', |
||
| 546 | 'number_decimals' => 2, |
||
| 547 | ), |
||
| 548 | ), |
||
| 549 | 'CUC' => array( |
||
| 550 | 'admin_label' => __( 'Cuban convertible peso (₱)', 'give' ), |
||
| 551 | 'symbol' => '₱', |
||
| 552 | 'setting' => array( |
||
| 553 | 'currency_position' => 'before', |
||
| 554 | 'thousands_separator' => ',', |
||
| 555 | 'decimal_separator' => '.', |
||
| 556 | 'number_decimals' => 2, |
||
| 557 | ), |
||
| 558 | ), |
||
| 559 | 'CUP' => array( |
||
| 560 | 'admin_label' => __( 'Cuban convertible peso (₱)', 'give' ), |
||
| 561 | 'symbol' => '₱', |
||
| 562 | 'setting' => array( |
||
| 563 | 'currency_position' => 'before', |
||
| 564 | 'thousands_separator' => ',', |
||
| 565 | 'decimal_separator' => '.', |
||
| 566 | 'number_decimals' => 2, |
||
| 567 | ), |
||
| 568 | ), |
||
| 569 | 'DOP' => array( |
||
| 570 | 'admin_label' => __( 'Dominican peso (RD$)', 'give' ), |
||
| 571 | 'symbol' => 'RD$', |
||
| 572 | 'setting' => array( |
||
| 573 | 'currency_position' => 'before', |
||
| 574 | 'thousands_separator' => ',', |
||
| 575 | 'decimal_separator' => '.', |
||
| 576 | 'number_decimals' => 2, |
||
| 577 | ), |
||
| 578 | ), |
||
| 579 | 'EGP' => array( |
||
| 580 | 'admin_label' => __( 'Egyptian pound (E£)', 'give' ), |
||
| 581 | 'symbol' => 'E£', |
||
| 582 | 'setting' => array( |
||
| 583 | 'currency_position' => 'before', |
||
| 584 | 'thousands_separator' => ',', |
||
| 585 | 'decimal_separator' => '.', |
||
| 586 | 'number_decimals' => 2, |
||
| 587 | ), |
||
| 588 | ), |
||
| 589 | 'GIP' => array( |
||
| 590 | 'admin_label' => __( 'Gibraltar pound (£)', 'give' ), |
||
| 591 | 'symbol' => '£', |
||
| 592 | 'setting' => array( |
||
| 593 | 'currency_position' => 'before', |
||
| 594 | 'thousands_separator' => ',', |
||
| 595 | 'decimal_separator' => '.', |
||
| 596 | 'number_decimals' => 2, |
||
| 597 | ), |
||
| 598 | ), |
||
| 599 | 'GTQ' => array( |
||
| 600 | 'admin_label' => __( 'Guatemalan quetzal (Q)', 'give' ), |
||
| 601 | 'symbol' => 'Q', |
||
| 602 | 'setting' => array( |
||
| 603 | 'currency_position' => 'before', |
||
| 604 | 'thousands_separator' => ',', |
||
| 605 | 'decimal_separator' => '.', |
||
| 606 | 'number_decimals' => 2, |
||
| 607 | ), |
||
| 608 | ), |
||
| 609 | 'HNL' => array( |
||
| 610 | 'admin_label' => __( 'Honduran lempira (L)', 'give' ), |
||
| 611 | 'symbol' => 'L', |
||
| 612 | 'setting' => array( |
||
| 613 | 'currency_position' => 'before', |
||
| 614 | 'thousands_separator' => ',', |
||
| 615 | 'decimal_separator' => '.', |
||
| 616 | 'number_decimals' => 2, |
||
| 617 | ), |
||
| 618 | ), |
||
| 619 | 'HRK' => array( |
||
| 620 | 'admin_label' => __( 'Croatian kuna (kn)', 'give' ), |
||
| 621 | 'symbol' => 'kn', |
||
| 622 | 'setting' => array( |
||
| 623 | 'currency_position' => 'after', |
||
| 624 | 'thousands_separator' => '.', |
||
| 625 | 'decimal_separator' => ',', |
||
| 626 | 'number_decimals' => 2, |
||
| 627 | ), |
||
| 628 | ), |
||
| 629 | 'IDR' => array( |
||
| 630 | 'admin_label' => __( 'Indonesian rupiah (Rp)', 'give' ), |
||
| 631 | 'symbol' => 'Rp', |
||
| 632 | 'setting' => array( |
||
| 633 | 'currency_position' => 'before', |
||
| 634 | 'thousands_separator' => '.', |
||
| 635 | 'decimal_separator' => ',', |
||
| 636 | 'number_decimals' => 2, |
||
| 637 | ), |
||
| 638 | ), |
||
| 639 | 'ISK' => array( |
||
| 640 | 'admin_label' => __( 'Icelandic króna (kr)', 'give' ), |
||
| 641 | 'symbol' => 'kr', |
||
| 642 | 'setting' => array( |
||
| 643 | 'currency_position' => 'after', |
||
| 644 | 'thousands_separator' => '.', |
||
| 645 | 'decimal_separator' => '', |
||
| 646 | 'number_decimals' => 0, |
||
| 647 | ), |
||
| 648 | ), |
||
| 649 | 'JMD' => array( |
||
| 650 | 'admin_label' => __( 'Jamaican dollar (J$)', 'give' ), |
||
| 651 | 'symbol' => 'j$', |
||
| 652 | 'setting' => array( |
||
| 653 | 'currency_position' => 'before', |
||
| 654 | 'thousands_separator' => ',', |
||
| 655 | 'decimal_separator' => '.', |
||
| 656 | 'number_decimals' => 2, |
||
| 657 | ), |
||
| 658 | ), |
||
| 659 | 'JOD' => array( |
||
| 660 | 'admin_label' => __( 'Jordanian dinar (د.ا)', 'give' ), |
||
| 661 | 'symbol' => 'د.ا', |
||
| 662 | 'setting' => array( |
||
| 663 | 'currency_position' => 'before', |
||
| 664 | 'thousands_separator' => ',', |
||
| 665 | 'decimal_separator' => '.', |
||
| 666 | 'number_decimals' => 3, |
||
| 667 | ), |
||
| 668 | ), |
||
| 669 | 'KES' => array( |
||
| 670 | 'admin_label' => __( 'Kenyan shilling (KSh)', 'give' ), |
||
| 671 | 'symbol' => 'KSh', |
||
| 672 | 'setting' => array( |
||
| 673 | 'currency_position' => 'before', |
||
| 674 | 'thousands_separator' => ',', |
||
| 675 | 'decimal_separator' => '.', |
||
| 676 | 'number_decimals' => 2, |
||
| 677 | ), |
||
| 678 | ), |
||
| 679 | 'KWD' => array( |
||
| 680 | 'admin_label' => __( 'Kuwaiti dinar (د.ك)', 'give' ), |
||
| 681 | 'symbol' => 'د.ك', |
||
| 682 | 'setting' => array( |
||
| 683 | 'currency_position' => 'before', |
||
| 684 | 'thousands_separator' => ',', |
||
| 685 | 'decimal_separator' => '.', |
||
| 686 | 'number_decimals' => 3, |
||
| 687 | ), |
||
| 688 | ), |
||
| 689 | 'KYD' => array( |
||
| 690 | 'admin_label' => __( 'Cayman Islands dollar (KY$)', 'give' ), |
||
| 691 | 'symbol' => 'KY$', |
||
| 692 | 'setting' => array( |
||
| 693 | 'currency_position' => 'before', |
||
| 694 | 'thousands_separator' => ',', |
||
| 695 | 'decimal_separator' => '.', |
||
| 696 | 'number_decimals' => 2, |
||
| 697 | ), |
||
| 698 | ), |
||
| 699 | 'MKD' => array( |
||
| 700 | 'admin_label' => __( 'Macedonian denar (ден)', 'give' ), |
||
| 701 | 'symbol' => 'ден', |
||
| 702 | 'setting' => array( |
||
| 703 | 'currency_position' => 'before', |
||
| 704 | 'thousands_separator' => ',', |
||
| 705 | 'decimal_separator' => '.', |
||
| 706 | 'number_decimals' => 2, |
||
| 707 | ), |
||
| 708 | ), |
||
| 709 | 'NPR' => array( |
||
| 710 | 'admin_label' => __( 'Nepalese rupee (NɌs)', 'give' ), |
||
| 711 | 'symbol' => '₨', |
||
| 712 | 'setting' => array( |
||
| 713 | 'currency_position' => 'before', |
||
| 714 | 'thousands_separator' => ',', |
||
| 715 | 'decimal_separator' => '.', |
||
| 716 | 'number_decimals' => 2, |
||
| 717 | ), |
||
| 718 | ), |
||
| 719 | 'OMR' => array( |
||
| 720 | 'admin_label' => __( 'Omani rial (ر.ع.)', 'give' ), |
||
| 721 | 'symbol' => 'ر.ع.', |
||
| 722 | 'setting' => array( |
||
| 723 | 'currency_position' => 'before', |
||
| 724 | 'thousands_separator' => ',', |
||
| 725 | 'decimal_separator' => '.', |
||
| 726 | 'number_decimals' => 3, |
||
| 727 | ), |
||
| 728 | ), |
||
| 729 | 'PEN' => array( |
||
| 730 | 'admin_label' => __( 'Peruvian nuevo sol (S/.)', 'give' ), |
||
| 731 | 'symbol' => 'S/.', |
||
| 732 | 'setting' => array( |
||
| 733 | 'currency_position' => 'before', |
||
| 734 | 'thousands_separator' => ',', |
||
| 735 | 'decimal_separator' => '.', |
||
| 736 | 'number_decimals' => 2, |
||
| 737 | ), |
||
| 738 | ), |
||
| 739 | 'PKR' => array( |
||
| 740 | 'admin_label' => __( 'Pakistani rupee (Ɍs)', 'give' ), |
||
| 741 | 'symbol' => '₨', |
||
| 742 | 'setting' => array( |
||
| 743 | 'currency_position' => 'before', |
||
| 744 | 'thousands_separator' => ',', |
||
| 745 | 'decimal_separator' => '.', |
||
| 746 | 'number_decimals' => 2, |
||
| 747 | ), |
||
| 748 | ), |
||
| 749 | 'RON' => array( |
||
| 750 | 'admin_label' => __( 'Romanian leu (L)', 'give' ), |
||
| 751 | 'symbol' => 'L', |
||
| 752 | 'setting' => array( |
||
| 753 | 'currency_position' => 'after', |
||
| 754 | 'thousands_separator' => '.', |
||
| 755 | 'decimal_separator' => ',', |
||
| 756 | 'number_decimals' => 2, |
||
| 757 | ), |
||
| 758 | ), |
||
| 759 | 'SAR' => array( |
||
| 760 | 'admin_label' => __( 'Saudi riyal (ر.س)', 'give' ), |
||
| 761 | 'symbol' => 'ر.س', |
||
| 762 | 'setting' => array( |
||
| 763 | 'currency_position' => 'before', |
||
| 764 | 'thousands_separator' => ',', |
||
| 765 | 'decimal_separator' => '.', |
||
| 766 | 'number_decimals' => 2, |
||
| 767 | ), |
||
| 768 | ), |
||
| 769 | 'SZL' => array( |
||
| 770 | 'admin_label' => __( 'Swazi lilangeni (L)', 'give' ), |
||
| 771 | 'symbol' => 'L', |
||
| 772 | 'setting' => array( |
||
| 773 | 'currency_position' => 'before', |
||
| 774 | 'thousands_separator' => ',', |
||
| 775 | 'decimal_separator' => '.', |
||
| 776 | 'number_decimals' => 2, |
||
| 777 | ), |
||
| 778 | ), |
||
| 779 | 'TOP' => array( |
||
| 780 | 'admin_label' => __( 'Tongan paʻanga (T$)', 'give' ), |
||
| 781 | 'symbol' => 'T$', |
||
| 782 | 'setting' => array( |
||
| 783 | 'currency_position' => 'before', |
||
| 784 | 'thousands_separator' => ',', |
||
| 785 | 'decimal_separator' => '.', |
||
| 786 | 'number_decimals' => 2, |
||
| 787 | ), |
||
| 788 | ), |
||
| 789 | 'TZS' => array( |
||
| 790 | 'admin_label' => __( 'Tanzanian shilling (TSh)', 'give' ), |
||
| 791 | 'symbol' => 'TSh', |
||
| 792 | 'setting' => array( |
||
| 793 | 'currency_position' => 'before', |
||
| 794 | 'thousands_separator' => ',', |
||
| 795 | 'decimal_separator' => '.', |
||
| 796 | 'number_decimals' => 2, |
||
| 797 | ), |
||
| 798 | ), |
||
| 799 | 'UAH' => array( |
||
| 800 | 'admin_label' => __( 'Ukrainian hryvnia (₴)', 'give' ), |
||
| 801 | 'symbol' => '₴', |
||
| 802 | 'setting' => array( |
||
| 803 | 'currency_position' => 'before', |
||
| 804 | 'thousands_separator' => ' ', |
||
| 805 | 'decimal_separator' => ',', |
||
| 806 | 'number_decimals' => 2, |
||
| 807 | ), |
||
| 808 | ), |
||
| 809 | 'UYU' => array( |
||
| 810 | 'admin_label' => __( 'Uruguayan peso ($U)', 'give' ), |
||
| 811 | 'symbol' => '$U', |
||
| 812 | 'setting' => array( |
||
| 813 | 'currency_position' => 'before', |
||
| 814 | 'thousands_separator' => '.', |
||
| 815 | 'decimal_separator' => ',', |
||
| 816 | 'number_decimals' => 2, |
||
| 817 | ), |
||
| 818 | ), |
||
| 819 | 'VEF' => array( |
||
| 820 | 'admin_label' => __( 'Venezuelan bolívar (Bs)', 'give' ), |
||
| 821 | 'symbol' => 'Bs', |
||
| 822 | 'setting' => array( |
||
| 823 | 'currency_position' => 'before', |
||
| 824 | 'thousands_separator' => '.', |
||
| 825 | 'decimal_separator' => ',', |
||
| 826 | 'number_decimals' => 2, |
||
| 827 | ), |
||
| 828 | ), |
||
| 829 | 'XCD' => array( |
||
| 830 | 'admin_label' => __( 'East Caribbean dollar (EC$)', 'give' ), |
||
| 831 | 'symbol' => 'EC$', |
||
| 832 | 'setting' => array( |
||
| 833 | 'currency_position' => 'before', |
||
| 834 | 'thousands_separator' => ',', |
||
| 835 | 'decimal_separator' => '.', |
||
| 836 | 'number_decimals' => 2, |
||
| 837 | ), |
||
| 838 | ), |
||
| 839 | ); |
||
| 840 | |||
| 841 | /** |
||
| 842 | * Filter the currencies |
||
| 843 | * Note: you can register new currency by using this filter |
||
| 844 | * array( |
||
| 845 | * 'admin_label' => '', // required |
||
| 846 | * 'symbol' => '', // required |
||
| 847 | * 'setting' => '' // required |
||
| 848 | * .... |
||
| 849 | * ) |
||
| 850 | * |
||
| 851 | * @since 1.8.15 |
||
| 852 | * |
||
| 853 | * @param array $currencies |
||
| 854 | */ |
||
| 855 | return (array) apply_filters( 'give_currencies', $currencies ); |
||
| 856 | } |
||
| 857 | |||
| 1192 | } |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.