Here’s the solution all coded out if you want to use it.
Change line 633 of event-organiser-venue-functions.php to this.
$tooltip_content = eo_address_formatter('a, c, s, p, C', $address);
Then add this function to the same file somewhere.
function eo_address_formatter($format, $address_array)
{
// Format characteers and their associated values
$format_map = array(
's' => 'state',
'c' => 'city',
'a' => 'address',
'p' => 'postcode',
'C' => 'country',
);
$address = "";
for($i = 0; $i < strlen($format); $i++)
{
if(isset($format_map[$format[$i]]))
{
$address .= $address_array[$format_map[$format[$i]]];
}
else
{
$address .=$format[$i];
}
}
return $address;
}
Then all we’d need is somewhere to be able to choose the format. Probably on the venue page so that way you can choose the format based on the venue, as some places may have events in more than one country.
So Google can’t find the Japanese address – this will need fixing. (By the way, for bugs like this, or code you want see in the plug-in – feel free to make a pull request https://github.com/stephenharris/Event-Organiser – much better forum for this kind of thing, and you get contributor kudos too 🙂 )/
As for the tooltip, you can already change the content of the tooltip using a filter – and so avoid making any changes to the core plug-in:
http://wp-event-organiser.com/documentation/hook/eventorganiser_venue_tooltip/
More generally there is nothing that ‘displays’ the venue address: eo_get_venue_address() returns the constituent parts as an address, so in a theme template you can free format it as desired. So I’ll put the address template idea on hold for now.
I’m also struggling to display Japanese address by using eo_get_venue_address(). Could you give me example codes?
For the moment my code looks like this to display an address starting, postcode, state, city, and address.
<?php $address_details = eo_get_venue_address(); echo $address_details['postcode']; ?><?php $address_details = eo_get_venue_address(); echo $address_details['state']; ?><?php $address_details = eo_get_venue_address(); echo $address_details['city']; ?><?php $address_details = eo_get_venue_address(); echo $address_details['address']; ?>
But it could be great if I can arrange the format within a one line of code, such as the following which made my page blank.
<?php $address_details = eo_get_venue_address(); echo $address_details['postcode','state','city','address'']; ?>
I have no idea about PHP, so more exapmples on your document would help us a lot!!
There’s no need to make repeated calls to eo_get_venue_address(), the following should work,
$address_details = eo_get_venue_address();
echo $address_details['postcode'];
echo $address_details['state'];
echo $address_details['city'];
echo $address_details['address'];
But for readability I would recommend the following:
$address_details = eo_get_venue_address();
printf(
'The venue is in %1$s, %2$s, and has postcode %3$s',
$address_details['city']
$address_details['state']
$address_details['postcode']
);
which displays something like ‘This venue is in [city],[state], and has postcode [postcode]’.