Is there any way to remove the Use New Venue option

Home Forums Calendar Products Events Calendar PRO Is there any way to remove the Use New Venue option

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1021332
    Luke
    Participant

    When creating new events it gives you the option to Use New Venue.

    Is there anyway to remove this so it only gives options of the venues I have already created?

    Kind regards,
    Luke

    #1021415
    George
    Participant

    Hey Luke,

    Just to be 100% clear, do you mean the venue fields in the wp-admin? These ones, specifically:

    Just want to make sure I know what you’re talking about โ€“ย I’m pretty darn certain this is what you mean but you never know ๐Ÿ™‚

    Assuming this is what you mean, then unfortunately the only way to go about doing this is with custom code. You can get started by first hiding all the extra fields for “new venue creation”, which you can do with this CSS:


    #event_venue.eventtable tr {
    display: none;
    }

    #event_venue.eventtable tr:first-of-type,
    #event_venue.eventtable tr:nth-child(2),
    #event_venue.eventtable tr:nth-child(3) {
    display: table-row !important;
    }

    Here’s how that makes things look for me:

    The dropdown still says “Use new venue”, obviously, but this is unfortunately not so easy to change ๐Ÿ™ You’d have to customize the chosen.js javascript directly which is a bit outside the scope of the forums here.

    I hope this is a good start though! If you’re not familiar with adding admin-facing CSS to your WordPress site, research this online โ€“ย there are many ways to do it and you should choose the option that best suits your needs.

    Cheers!
    George

    #1021606
    Luke
    Participant

    Hi George,

    Thanks for the reply. Yeah that was the Venue section I was referring to, I had already removed the extra fields using custom CSS and changing the Use new venue text is the last past I need to fix. Simply changing this placeholder text will work but I have so far been unable to locate the correct JS file. I don’t suppose you know which file I need to locate do you, or at least some idea of the correct folder would be useful as a starting point.

    Kind regards,
    Luke

    #1021800
    George
    Participant

    Thanks for elaborating on things Luke โ€“ย I can point you to where that text is dictated, but as I noted it is unfortunately a bit of complex customization ๐Ÿ™ It’s also something you cannot alter from a filter or something; meaning you have to edit core plugin code, meaning these changes will be overwritten each time you update the plugin and thus have to be re-added.

    But onto the location of this text itself โ€“ย I actually misspoke earlier about this being primarily dictated by JavaScript. It’s actually generated by a method called saved_venues_dropdown() which belongs to the Tribe__Events__Main class.

    To find this, head to the following file: the-events-calendar/src/Tribe/Main.php

    The saved_venues_dropdown() method resides around line 1628 or so of the file.

    The meat of the code that actually displays the HTML markup, and thus the “Use new Venue” text, all lives in this method.

    Around line 1707 or so, you’ll see code like this:

    echo '<option value="0">' . esc_html( sprintf( __( 'Use New %s', 'the-events-calendar' ), $this->singular_venue_label ) ) . '</option>';

    Change 'Use New %s' to something like 'Choose a %s' (the %s will be auto-replaced with the word “Venue”) and you should be good to go.

    I hope this helps!

    โ€” George

    #1075387
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Is there any way to remove the Use New Venue option’ is closed to new replies.