acfcs_get_countries()

Description

This function returns an array containing all countries, with country code as key and the country name as label.

Usage

  1. $countries = acfcs_get_countries();

Returns

  1. array(
  2.   'BE' => 'Belgium',
  3.   'NL' => 'Netherlands'
  4. )

This function makes use of a transient, called 'acfcs_countries'.

Arguments

  • (bool) - $show_first (optional)
    Whether to include an empty option (used for dropdowns) | default false.
  • (bool) - $show_labels (optional)
    Whether to show a text in the first option (used for dropdowns) | default false.
  • (bool) - $force (optional)
    Whether to bypass the stored country transient (or not) | default false.

Defined in

inc/acfcs-functions.php - line 19

Used in