Hi,
you can do that either with the Maps and Locations extension or by adding the code below in your theme functions.php file (or even better create a new blank plugin https://wpadverts.com/blog/how-to-use-code-snippets-in-wordpress/ and paste the code there so it will not be overwritten on the theme update).
add_filter( "adverts_form_load", function( $form ) {
if( $form["name"] != "advert" ) {
return $form;
}
$options = array(
array( "value" => "London", "text" => "London" ),
array( "value" => "New York", "text" => "New York" ),
);
foreach( $form["field"] as $k => $f ) {
if( $f["name"] == "adverts_location" ) {
$form["field"][$k]["type"] = "adverts_field_select";
$form["field"][$k]["empty_option"] = true;
$form["field"][$k]["empty_option_text"] = "Select location ...";
$form["field"][$k]["options"] = $options;
}
}
return $form;
} );
The locations you would like to show you need to customize in the above snippet.
Hi Greg,
thank you very much. B.