So you’ve got our calendar and events templates customized and looking just the way you want. Maybe you’ve even hooked into the event query to alter what’s showing on specific pages. Then you update to the latest version of the plugin, and now there’s scary errors. What happened, and how can you fix it?

In The Events Calendar 6.0, we removed a number of functions and methods. These elements were previously deprecated in previous versions, as far back as TEC 4.0 (2015). If you’re using a deprecated function, your site will usually show a warning so that you can deal with the change before the element is fully removed. However, if you have a plugin or snippet that suppresses the warnings, you wouldn’t have seen anything to prompt you to prepare for the final removal of these elements. If you want to use The Events Calendar 6.0+, you’ll need to now take the time to adjust your customizations.

Custom Templates

The first step to resolving these issues is to review and decode the error message. Let’s say you get something like:

Fatal error: Uncaught Error: Call to undefined function tribe_events_the_notices() in /home/my-site/www/wp-content/themes/my-theme/tribe-events/single-event.php:30

That’s a bit scary, but it includes important and helpful information:

  • It’s happening in the custom template as the path includes the theme: wp-content/themes/my-theme/tribe-events/single-event.php
  • The failing function is tribe_events_the_notices()

Next, check the release notes for the update. For an error like the above, you’ll want the developer notes on templates.

If you search for the failing function tribe_events_the_notices(), you’ll find it under “Removed functions & methods”. Next, we’ll go to the release readme file for more information.

For simplicity’s sake, here’s a link to the readme on GitHub, but it’s in the folder of our plugin – we can get to it using the plugin editor on-site, via FTP, or by downloading the plugin from wordpress.org and opening the zip file.

If you search for the above the function in the readme, you’ll find it deprecated in the TEC 4.0 release. Most importantly, it says:

Deprecated - tribe_events_the_notices() in favor of tribe_the_notices() 

That means to fix it, you’ll need to change the use of tribe_events_the_notices() to tribe_the_notices() in your custom template. Once you’ve done that, the error will be resolved.

Hooked Functions

If you have hooked into an event query or a template to customize your site, the error will point to the customization. For example, you might see something like this:

Fatal error: Uncaught Error: Call to undefined function tribe_events_the_notices() in /Users/stephenpage/Sites/tec/dev/themes/twentytwentyone/functions.php:662

In this example, we’re using Twenty Twenty One theme, and we’ve put a filter in the theme functions.php file. There are other places it could be on your site, such as in a custom plugin, a code snippet plugin, a child theme, etc.

The example customization hooks into tribe_get_events_title though it doesn’t really matter which hook we’re using just to demonstrate. Nor does it matter if it’s a filter or action hook–we just need one that will fire on an events page load. We’ll also use the same example function for consistency – tribe_events_the_notices().

Say your customization looks something like this:

add_filter(
	'tribe_get_events_title',
	function ( $title, $depth, $context ) {
		// Let's break something :wink:
		$notices = tribe_events_the_notices();

		return $title;
	},
	10,
	3
);

Reviewing the error message, you can see the file is in the theme’s functions.php file, and a line number – 662. Go to line 662 in functions.php, and look for the problematic element. In our example, it’s tribe_events_the_notices() from the snippet above.

Next, look for the function in the developer notes from the release, and then in the plugin readme. The readme shows that tribe_events_the_notices() was replaced by the new tribe_the_notices(). Adjust your customization to use the new function, and the error will be resolved.

Dealing with Multiple Errors

Quite a few functions, classes, and methods that had been deprecated in previous versions were fully removed in 6.0. If you’re running into multiple errors caused by missing elements, you may need some time to find all the issues and get your site straightened out.

We recommend that you downgrade to The Events Calendar 5.16.4, and then find and remove whatever was previously suppressing deprecation warnings. This could be a plugin or a snippet in your theme functions.php file. It’s important to see deprecation warnings on your site so that you can make required changes before something triggers an actual error. If you have any of our other calendar or tickets plugins, you’ll also need to downgrade those (see versions below).

Once you’ve downgraded and can view deprecation warnings, you can go through the same steps described above to replace any use of deprecated functions, methods, or classes. When you have resolved all warnings both in the WordPress admin and on the site frontend, you can then confidently update back to the most recent version of The Events Calendar (6.0+) and any other plugins.

The following versions of our plugins are compatible with The Events Calendar 5.16.4. Be sure to downgrade any of these that you have active:

  • Events Calendar Pro 5.14.4
  • Event Tickets 5.4.4
  • Event Tickets Plus 5.5.3
  • Community Events 4.9.3
  • Community Tickets 4.7.13
  • Filter Bar 5.3.1
  • Virtual Events 1.11.0
  • Eventbrite Tickets 4.6.11