Tribe__Events__Editor::hook()

Hooks actions from the editor into the correct places


Return

(bool)


Top ↑

Source

File: src/Tribe/Editor.php

	public function hook() {
		add_filter( 'tribe_events_register_event_type_args', array( $this, 'add_event_template_blocks' ) );

		// Add Rest API support
		add_filter( 'tribe_events_register_event_type_args', array( $this, 'add_rest_support' ) );
		add_filter( 'tribe_events_register_venue_type_args', array( $this, 'add_rest_support' ) );
		add_filter( 'tribe_events_register_organizer_type_args', array( $this, 'add_rest_support' ) );

		// Maybe add flag from classic editor
		add_action( 'load-post.php', array( $this, 'flag_post_from_classic_editor' ), 0 );

		// Update Post content to use blocks
		add_action( 'tribe_blocks_editor_flag_post_classic_editor', array( $this, 'update_post_content_to_blocks' ) );

		// Remove assets that are not relevant for Gutenberg Editor
		add_action( 'wp_print_scripts', array( $this, 'deregister_scripts' ) );

		// Setup the registration of Blocks
		add_action( 'init', array( $this, 'register_blocks' ), 20 );

		// Load assets of the blocks
		add_action( 'admin_init', array( $this, 'assets' ) );

		// Add Block Categories to Editor
		add_action( 'block_categories', array( $this, 'block_categories' ), 10, 2 );

		// Make sure Events supports 'custom-fields'
		add_action( 'init', array( $this, 'add_event_custom_field_support' ), 11 );

		/**
		 * @todo Move away from the generic to the new filter once it's introduced
		 *       See: https://core.trac.wordpress.org/ticket/45275
		 *
		 *       E.g.: `use_block_editor_for_{post_type}`
		 */
		add_filter( 'use_block_editor_for_post_type', array( $this, 'deactivate_blocks_editor_venue' ), 10, 2 );
		add_filter( 'use_block_editor_for_post_type', array( $this, 'deactivate_blocks_editor_organizer' ), 10, 2 );
	}

Top ↑

Changelog

Changelog
Version Description
4.7 Introduced.