Gform countries

Description

This filter can be used to add or remove countries from the address field country drop down

Usage

<?php
add_filter("gform_countries", "change_countries");
?>

Parameters

$countries

(array) The array to be filtered. It contains The list of countries in a standard array (see sample below)

<?php
array("Argentina", "Brazil", "Netherlands", "United States", "United Kingdom", .....);

?>

Examples

This example demonstrates how to limit the country drop down to only a few select countries.


<?php

add_filter("gform_countries", "remove_country");
function remove_country($countries){
    return array("Brazil", "United States", "Netherlands", "United Kingdom");
}

?>

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in common.php

Search the Documentation