Hooks::action_disable_shortcode_v1()

Remove old shortcode methods from views v1.


Return

(void)


Top ↑

Source

File: src/Tribe/Views/V2/Shortcodes/Hooks.php

	public function action_disable_shortcode_v1() {
		remove_shortcode( 'tribe_events' );
		remove_shortcode( 'tribe_events_list' );
		remove_shortcode( 'tribe_this_week' );
		remove_shortcode( 'tribe_mini_calendar' );

		$legacy_shortcodes_instance = tribe( 'events-pro.main' )->shortcodes;

		// Prevents removal with the incorrect class.
		if ( ! $legacy_shortcodes_instance instanceof Legacy_Shortcodes ) {
			return;
		}

		remove_action( 'tribe_events_ical_before', [ $legacy_shortcodes_instance, 'search_shortcodes' ] );
		remove_action( 'save_post', [ $legacy_shortcodes_instance, 'update_shortcode_main_calendar' ] );
		remove_action( 'trashed_post', [ $legacy_shortcodes_instance, 'maybe_reset_main_calendar' ] );
		remove_action( 'deleted_post', [ $legacy_shortcodes_instance, 'maybe_reset_main_calendar' ] );

		// Hooks attached to the main calendar attribute on the shortcodes
		remove_filter( 'tribe_events_get_link', [ $legacy_shortcodes_instance, 'shortcode_main_calendar_link' ], 10 );
	}

Top ↑

Changelog

Changelog
Version Description
5.5.0 Moved this from deprecated ShortcodesManager.
4.7.5 Introduced.