Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Created January 29, 2024 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrasguseo/461f2ffd8a43ec7503f0181b66cfc132 to your computer and use it in GitHub Desktop.
Save andrasguseo/461f2ffd8a43ec7503f0181b66cfc132 to your computer and use it in GitHub Desktop.
CE > Show input for lat/long coordinates on the venue editing page in Community Events
<?php
/**
* Show input fields for lat/long coordinates on the venue editing page in Community Events.
*
* Usage: Add the snippet to your functions.php file or with a plugin like Code Snippets.
*
* @author: Andras Guseo
*
* Plugins required: The Events Calendar, Events Calendar Pro, Community Events
* Created: January 29, 2024
*/
function tec_ce_show_coordinates() {
$coords = tribe_get_coordinates();
?>
<div class="venue">
<label for="Latitude">
<?php esc_html_e( 'Latitude', 'tribe-events-community' ); ?>:
</label>
<input
type="text"
id="VenueLatitude"
name="venue[Lat]"
size="14"
value="<?php echo esc_attr( $coords['lat'] ); ?>"
/>
</div>
<div class="venue">
<label for="Longitude">
<?php esc_html_e( 'Longitude', 'tribe-events-community' ); ?>:
</label>
<input
type="text"
id="VenueLongitude"
name="venue[Lng]"
size="14"
value="<?php echo esc_attr( $coords['lng'] ); ?>"
/>
</div>
<?php
}
add_action( 'tribe_events_community_after_venue_meta', 'tec_ce_show_coordinates' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment