Modify the list of countries shown in the dropdown
Locate the country list
Open libs/help_functions.php
and find the function wprentals_return_country_array()
.
It returns the full list of countries used throughout the theme:
if (!function_exists('wprentals_return_country_array')):
function wprentals_return_country_array() {
$countries = array(
'Afghanistan' => esc_html__('Afghanistan', 'wprentals'),
'Albania' => esc_html__('Albania', 'wprentals'),
'Algeria' => esc_html__('Algeria', 'wprentals'),
// ...
);
// return $countries;
}
endif;
}
Remove, add, or edit entries
Remove a country: delete its line from the $countries
array.
Add a country: insert a new line with 'Country Name' => esc_html__('Country Name', 'wprentals'),
.
Rename a country: change both the array key and its translated label.
Optional – override in a child theme
Because the function is wrapped in if (!function_exists(...))
, you can copy it into a child theme’s functions.php
and customize the array there. This keeps changes safe from theme updates.
Where the list is used
The dropdowns are populated by wpestate_country_list_search(), which pulls the array above and builds the options:
if( !function_exists('wpestate_country_list_search') ):
function wpestate_country_list_search($selected) {
$countries = wpestate_return_country_list_translated();
$country_select_list = '';
foreach ($countries as $country) {
$country_select_list .= '<li role="presentation" data-value="' . esc_attr($country) . '">' . $country . '</li>';
}
}
endif;
Updating wprentals_return_country_array()
will automatically reflect in all dropdowns generated through this search helper.