Provider::register()

Selectively manipulates the previous version hooks in the Filters API to integrate correctly with the previous version implementation.

Contents


Source

File: src/Events_Pro/Custom_Tables/V1/Legacy_Compat/Provider.php

	public function register() {
		if ( ! has_action( 'init', [ $this, 'remove_legacy_init_hooks' ] ) ) {
			add_action( 'init', [ $this, 'remove_legacy_init_hooks' ], 15 );
		}

		if ( ! has_action( 'wp_before_admin_bar_render', [ $this, 'update_admin_bar' ] ) ) {
			add_action( 'wp_before_admin_bar_render', [ $this, 'update_admin_bar' ] );
		}

		if ( ! has_action( 'wp_ajax_gutenberg_events_pro_recurrence_queue', [ $this, 'no_queue' ] ) ) {
			add_action( 'wp_ajax_gutenberg_events_pro_recurrence_queue', [ $this, 'no_queue' ], 1 );
		}

		$this->disconnect_pro_realtime_queue();
		$this->unhook_recurrence_meta_updates();

		// Remove redirection on single occurrence view.
		$pro = Pro_Main::instance();
		remove_filter( 'wp', [ $pro, 'detect_recurrence_redirect' ] );

		// Remove the filter with the row actions on recurring events.
		remove_filter( 'post_row_actions', [ Pro_Recurrence_Meta::class, 'edit_post_row_actions' ] );

		// Prevents PRO from updating the Event Post Recurrence meta and Occurrences.
		if ( ! has_filter( 'tribe_events_pro_editor_save_recurrence_meta', '__return_true' ) ) {
			add_filter( 'tribe_events_pro_editor_save_recurrence_meta', '__return_true' );
		}

		// Remove the notice for all occurrences on a series.
		Admin_Notices::instance()->remove( 'editing-all-recurrences' );

		// Remove the PRO filters that are setting up queries on Recurring Events.
		remove_action( 'tribe_events_pre_get_posts', [ $pro, 'setup_hide_recurrence_in_query' ] );

		if ( ! has_filter( 'tribe_settings_tab_fields', [ $this, 'rename_recurring_settings_on_admin' ] ) ) {
			add_filter( 'tribe_settings_tab_fields', [ $this, 'rename_recurring_settings_on_admin' ], 10, 2 );
		}

		// Do not redirect from post names to child posts.
		remove_action( 'parse_query', [ $pro, 'set_post_id_for_recurring_event_query' ], 101 );
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.