Tribe__PUE__Checker::hooks()

Install the hooks required to run periodic update checks and inject update info into WP data structures.

Also other hooks related to the automatic updates (such as checking agains API and what not (@from Darren)


Source

File: src/Tribe/PUE/Checker.php

		public function hooks() {
			// Override requests for plugin information
			add_filter( 'plugins_api', array( $this, 'inject_info' ), 10, 3 );

			// Check for updates when the WP updates are checked and inject our update if needed.
			// Only add filter if the TRIBE_DISABLE_PUE constant is not set as true and where
			// the context is not 'service'
			if ( ( ! defined( 'TRIBE_DISABLE_PUE' ) || true !== TRIBE_DISABLE_PUE ) && 'service' !== $this->context ) {
				add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_for_updates' ) );
			}

			add_filter( 'tribe_licensable_addons', array( $this, 'build_addon_list' ) );
			add_action( 'tribe_license_fields', array( $this, 'do_license_key_fields' ) );
			add_action( 'tribe_settings_after_content_tab_licenses', array( $this, 'do_license_key_javascript' ) );
			add_action( 'tribe_settings_success_message', array( $this, 'do_license_key_success_message' ), 10, 2 );
			add_action( 'load-plugins.php', array( $this, 'remove_default_inline_update_msg' ), 50 );

			// Key validation
			add_filter( 'tribe_settings_save_field_value', array( $this, 'check_for_api_key_error' ), 10, 3 );
			add_action( 'wp_ajax_pue-validate-key_' . $this->get_slug(), array( $this, 'ajax_validate_key' ) );
			add_filter( 'tribe-pue-install-keys', array( $this, 'return_install_key' ) );
			add_action( 'admin_enqueue_scripts', array( $this, 'maybe_display_json_error_on_plugins_page' ), 1 );
			add_action( 'admin_init', array( $this, 'general_notifications' ) );

			// Package name
			add_filter( 'upgrader_pre_download', array( Tribe__PUE__Package_Handler::instance(), 'filter_upgrader_pre_download' ), 5, 3 );
		}