Help Desk

Uncheck google maps by default (venue details) – Community Events

  • Posts: 16 Topics: 3
    | Permalink


    We recently purchased the Community Events plugin. I have been customising it for our use cases and it generally looks good now.

    But I notice when events are created via the Community Events form, they go in with the Google Maps link and display checked on the event (venue details). See attached screenshot.

    These are usually wildly inaccurate and we like to turn this off by default on our events. We actually organise photo shoots for our community and getting the location right is critical for us.

    What is your recommended approach to customise these to be turned off / unchecked when creating a new event via Community Events?

    Kind regards

    • This topic was modified 1 year, 1 month ago by  focusphoto. Reason: clarified more info
    Posts: 144
    | Permalink

    Hey there.

    First of all welcome to the support forums. This can be done via WordPress hooks so you need to paste a little snippet of code in your functions.php in your active theme.

    function tribe_community_event_remove_default_map_options( $event_id ) {
        $venue_id = tribe_get_venue_id( $event_id );
        update_post_meta( $venue_id, '_VenueShowMapLink', 'false' );
        update_post_meta( $venue_id, '_VenueShowMap', 'false' );
    // This will remove the default options only on new commuity events created
    add_action( 'tribe_community_event_created', 'tribe_community_event_remove_default_map_options' );

    The code above will make sure every new community event created will remove those 2 default options however if you want to do that as well every time a new community event is updated as well you need to add the following line of code as well.

    add_action( 'tribe_community_event_updated', 'tribe_community_event_remove_default_map_options' );

    Let me know if you have any questions about this.

    Best and happy holidays.

    Posts: 16 Topics: 3
    | Permalink

    Hi there,

    Thanks for your reply. Okay I have applied both those do_action hooks, and it is partly working.

    It appears that the VENUE does get created (and also on edits) with the Google Maps disabled.

    However on the Event itself, there are another set of checkboxes which are not getting disabled. See attached screenshot.

    I have also tried adding in these lines, in addition to the $venue_id lines you originally sent. Unfortunately adding these in does not disable the checkboxes on the Event either. Only on the venue details.

    update_post_meta( $event_id, '_VenueShowMapLink', 'false' );
    update_post_meta( $event_id, '_VenueShowMap', 'false' );


    • This reply was modified 1 year, 1 month ago by  focusphoto.
    • This reply was modified 1 year, 1 month ago by  focusphoto. Reason: Updated info
    Posts: 16 Topics: 3
    | Permalink
    Correct Answer

    Hi there,

    Okay I got it working, I had to add in some additional lines into the function. This seems to make it work:

    update_post_meta( $event_id, '_EventShowMapLink', 'false' );
        update_post_meta( $event_id, '_EventShowMap', 'false' );

    Thanks for sorting this out for us!


    Posts: 144
    | Permalink


    I’m glad I was able to give you some help on this one.

    | Permalink

The topic ‘Uncheck google maps by default (venue details) – Community Events’ is closed to new replies.