Remove Recurring Info from List View

Home Forums Calendar Products Events Calendar PRO Remove Recurring Info from List View

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1216809
    Kay
    Participant

    I need to remove the recurring info from my list view. I did see a css solution posted in a couple threads

    (https://theeventscalendar.com/support/forums/topic/how-to-remove-text-recurring-event-see-all-from-recurring-events/, https://theeventscalendar.com/support/forums/topic/recurring-event-text-appears-in-the-list-view/)

    but I need it to be completely absent from the DOM.

    I am using <?php echo tribe_events_event_schedule_details(); ?> to display the date info for the event, but the recurring info is being inserted into it and modifying the markup of that whole area in a way that does not work with my theme.

    Is there a php filter I can use to remove this completely?

    #1217347
    Barry
    Member

    Hi James,

    Would a solution like this work for you?

    function maybe_remove_rec_tooltip( $template ) {
    	// Do not interfere if this isn't the list view
    	if ( 'list/content.php' !== $template ) {
    		return;
    	}
    
    	// Safety check, in case PRO has been deactivated
    	if ( ! class_exists( 'Tribe__Events__Pro__Main' ) ) {
    		return;
    	}
    
    	// Disabled recurrence tooltips
    	Tribe__Events__Pro__Main::instance()->disable_recurring_info_tooltip();
    
    	// Restore once list view has finished rendering
    	add_action( 'tribe_after_get_template_part', 'restore_rec_tooltip' );
    }
    
    function restore_rec_tooltip( $template ) {
    	// Do not interfere if this isn't the list view
    	if ( 'list/content.php' !== $template ) {
    		return;
    	}
    
    	// Disabled recurrence tooltips
    	Tribe__Events__Pro__Main::instance()->enable_recurring_info_tooltip();
    }
    
    add_action( 'tribe_before_get_template_part', 'maybe_remove_rec_tooltip' );

    (This could be added to a custom plugin or even to your theme’s functions.php file, though if the latter is not a custom theme you’d want to be wary of losing changes upon future updates.)

    The idea is that it detects list view is being rendered, disables the recurrence tooltips, then restores them afterwards. If you prefer to disable them entirely, across all views and not just list view, you could use a similar – but simpler approach.

    Does that help at all?

    #1217653
    Kay
    Participant

    Thanks! That is useful. I didn’t need such a complex solution, so I ended up with just:

    function bhass_remove_rec_tooltip( $template ) {
        Tribe__Events__Pro__Main::instance()->disable_recurring_info_tooltip();
    }

    Works great : )

    #1217683
    Barry
    Member

    Awesome!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Remove Recurring Info from List View’ is closed to new replies.