<?php 
require_once( WPCSTL_PATH.'includes/locations-brisbane.php');
require_once( WPCSTL_PATH.'includes/locations-melbourne.php');
require_once( WPCSTL_PATH.'includes/locations-sydney.php');
function wpcstl_location_postcodes(){
    $brisbane   = array_filter( array_values( wpcstl_locations_brisbane() ) );
    $melbourne  = array_filter( array_values( wpcstl_locations_melbourne() ) );
    $sydney     = array_filter( array_values( wpcstl_locations_sydney() ) );
    return array_merge( $brisbane, $melbourne, $sydney );
}
function wpcstl_location_cities(){
    $brisbane   = array_filter( wpcstl_locations_brisbane() ) ;
    $melbourne  = array_filter( wpcstl_locations_melbourne() ) ;
    $sydney     = array_filter( wpcstl_locations_sydney() ) ;
    $all_cities = array_keys( array_merge( $brisbane, $melbourne, $sydney ) );
    asort($all_cities);
    return $all_cities;
}
function wpcstl_opt_location( $area ){
    $func_name  = 'wpcstl_locations_'.$area;
    if( !function_exists( $func_name ) ){
        return array();
    }
    $locations  = $func_name();
    array_walk( $locations, function( &$key, $value ){
        $key = $key .'-'.$value;
    } );
    return array_values( $locations );
}