WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [the event calendar] PHP returns variable, but shouldn't (2 posts)

  1. madsrh123
    Member
    Posted 1 year ago #

    I simply don't understand why this code behaves the way it does. I just want it to echo eighter A or B, but it writes the the organizer_link and A (like this http://www.google.comA)

    <?php
    $organizer_link = tribe_get_organizer_link( get_the_ID(), false, true);
    if ($organizer_link !== '') {
    echo 'A'
      ;}
        else echo 'B';
      ;
    ?>

    tribe_get_organizer_link is from The Event Calendar plugin where I found this documentation: http://tri.be/support/documentation/the-events-calendar-template-tags-organizer-functions/

    Can anyone tell me what's wrong?

  2. madsrh123
    Member
    Posted 1 year ago #

    Solved! Here's the answer:

    <?php
    $billetnet_link = esc_url(tribe_get_event_meta( tribe_get_organizer_id( $postId ), '_OrganizerWebsite', true ));
    if ($billetnet_link != '') {
    echo 'A'
      ;}
        else echo 'B';
      ;
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic