• Resolved Hoet

    (@hoet)


    I have tried to push it to the repository, but I get a 403 when I try to push the changes.

    Commmit description:
    The event title will not display “private” when the data is generated via admin-ajax.php. the_title() will only return ‘Private’ on a non admin page. is_admin() is used for that. But when you call the_title() within an admin-ajax.php request is_admin() always returning true and thus ‘Private’ isn’t added to the title.

    Site in question: http://mediastadeventshilversum.nl/evenementen/maand/?tribe-bar-date=2015-04-27

    views/day and views/list should be changed as follows:

    Before:

    <?php do_action( 'tribe_events_before_the_event_title' ) ?>
    <h2 class="tribe-events-list-event-title summary">
    	<a class="url" href="<?php echo esc_url( tribe_get_event_link() ); ?>" title="<?php the_title() ?>" rel="bookmark">
    		<?php the_title() ?>
    	</a>
    </h2>
    <?php do_action( 'tribe_events_after_the_event_title' ) ?>

    After:

    <?php
      global $post;
    
      $title =$post->post_title;
      if( !current_user_can( 'manage_options' ) && $post->post_status == 'private' )
      {
        $title =__( 'Private', 'tribe-events-calendar' ) . ': ' . $title;
      }
    
      do_action( 'tribe_events_before_the_event_title' );
    ?>
    <h2 class="tribe-events-list-event-title summary">
      <a class="url" href="<?php echo esc_url( tribe_get_event_link() ); ?>" title="<?= $title; ?>" rel="bookmark">
        <?= $title; ?>
      </a>
    </h2>
    <?php do_action( 'tribe_events_after_the_event_title' ) ?>

    https://wordpress.org/plugins/the-events-calendar/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘event title not always correct’ is closed to new replies.