Created
January 29, 2024 23:33
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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