Skip to content

Instantly share code, notes, and snippets.

@dave-mills
dave-mills / example.php
Last active September 28, 2020 08:05
Example Callback function for Ultimate Member dropdown field
function getCities() {
//get the value from the 'parent' field, sent via the AJAX post.
$choice = $_POST['parent_option'];
//Depending on the value of $choice, return a different array.
switch($choice) {
case "France":
$cities = [
"Paris" =>"Paris",