tribe_get_venue() output as name and not as link

Home Forums Calendar Products Events Calendar PRO tribe_get_venue() output as name and not as link

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1154054
    Kevin
    Participant

    I’m having some difficulties with venue.php file.

    I’d like to display the value name as plain text and NOT as a link. Currently the function being used is <?php echo tribe_get_venue() ?> but it outputs the venue name as a link (based on the website information included in the venue CPT).

    If not using this function, how can I output the venue name in the noted file?

    #1154056
    Kevin
    Participant

    I should note that the venues.php file I am referring to is in:

    modules/meta/venue.php

    #1154244
    Brook
    Participant

    Howdy Kevin,

    I would love to help you with this.

    We have two relevant functions here:

    https://theeventscalendar.com/function/tribe_get_venue/

    https://theeventscalendar.com/function/tribe_get_venue_link/

    Are you certain you are not using tribe_get_venue_link() ? tribe_get_venue() should only be returning the title.

    Cheers!

    – Brook

    #1154288
    Kevin
    Participant

    See the attached screenshot.

    I’ve tried both and they provide the same results.

    I’ve disabled all other plugins to see if there were some odd conflicts, but there are none.

    I’ve also reviewed the file at:
    /wp-content/plugins/the-events-calendar/src/functions/template-tags/venue.php
    and the functions seem to be correct there (I haven’t altered this file).

    So I can only assume there’s a function elsewhere which is conflicting.

    #1154401
    Mathew
    Participant

    Kevin,

    Give this a try.


    <?php echo strip_tags(tribe_get_venue() )?>

    Hope this helps.

    #1154533
    Kevin
    Participant

    Thanks. This solved it.

    #1154701
    Brook
    Participant

    Oh I see what is happening. Events Calendar Pro is hooking into the ‘tribe_get_venue’ filter and returning the link when it thinks it is in the modules/venue.php file. Yours must be tripping it up a bit. That seems like a bug to me, I’ll log a ticket to see if there is a refined way for us to do this.

    Regardless thought Mathew’s workaround is a great idea. That should keep working even after we patch this.

    Thanks for pointing this out Kevin.

    Cheers!

    – Brook

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘tribe_get_venue() output as name and not as link’ is closed to new replies.