Tribe__Events__Community__Tickets__Main::hooks()

All your hooks are belong to us!


Source #

File: src/Tribe/Main.php

	public function hooks() {
		tribe_register_provider( Tribe__Events__Community__Tickets__Service_Provider::class );
		tribe_register_provider( Payouts_Provider::class );

		add_action( 'init', [ $this, 'init' ], 5 );

		// this allows event owners to fetch/read orders on posts they own
		add_filter( 'user_has_cap', [ $this, 'user_has_read_private_shop_orders' ], 10, 3 );
		add_filter( 'user_has_cap', [ $this, 'user_has_edit_event_tickets_cap' ], 1, 3 );
		add_filter( 'user_has_cap', [ $this, 'user_has_sell_event_tickets_cap' ], 2, 3 );
		add_filter( 'user_has_cap', [ $this, 'user_has_edit_tribe_events_cap' ], 2, 3 );

		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
			add_action( 'wp_enqueue_scripts', [ $this, 'register_resources' ] );

			$this->event_form();
			$this->payment_options_form();
			$this->templates();

			add_filter( 'user_has_cap', [ $this, 'give_subscribers_upload_files_cap' ], 10, 3 );
		}

		add_action( 'admin_enqueue_scripts', [ $this, 'register_resources' ] );
		add_action( 'admin_enqueue_scripts', [ $this, 'maybe_enqueue_admin_resources' ], 11 );

		add_action( 'tribe_community_events_enqueue_resources', [ $this, 'maybe_enqueue_frontend' ] );
		add_action( 'wp_enqueue_scripts', [ $this, 'maybe_enqueue_frontend' ] );

		add_filter( 'tribe_events_template_paths', [ $this, 'add_template_paths' ] );
		add_action( 'wp_router_generate_routes', [ $this, 'generate_routes' ] );
		add_action( 'tribe_events_community_event_list_table_row_actions', [ $this, 'report_links' ] );

		add_filter( 'tribe_community_settings_tab', [ $this, 'community_tickets_settings' ] );

		add_action( 'woocommerce_order_item_meta_start', [ $this, 'add_order_item_details' ], 10, 3 );

		add_action( 'wp_ajax_tribe-ticket-add-Tribe__Events__Tickets__Woo__Main', [ $this, 'ajax_handler_ticket_save' ], 9 );
		add_action( 'wp_ajax_tribe-ticket-edit-Tribe__Events__Tickets__Woo__Main', [ $this, 'ajax_handler_ticket_save' ], 9 );

		// Determine if the ticket price can be updated.
		add_filter( 'tribe_tickets_can_update_ticket_price', [ $this, 'can_update_ticket_price' ], 10, 2 );
		add_filter( 'tribe_tickets_disallow_update_ticket_price_message', [ $this, 'disallow_update_ticket_price_message' ], 10, 2 );

		add_action( 'tribe_tickets_plus_after_event_details_list', [ $this, 'order_report_organizer_data' ], 10, 2 );

		// Control the user's ability to delete tickets.
		add_filter( 'tribe_tickets_current_user_can_delete_ticket', [ $this, 'can_delete_existing_ticket' ], 10, 2 );

		// Control the user's ability to check in attendees.
		add_filter( 'tribe_tickets_user_can_manage_attendees', [ $this, 'user_can_manage_own_event_attendees' ], 11, 3 );

		// Compatibility with Event Tickets Plus.
		add_action( 'wp_ajax_tribe-ticket-add-Tribe__Tickets__Woo__Main', [ $this, 'ajax_handler_ticket_save' ], 9 );
		add_action( 'wp_ajax_tribe-ticket-edit-Tribe__Tickets__Woo__Main', [ $this, 'ajax_handler_ticket_save' ], 9 );

		// Ticket fee settings.
		add_filter( 'tribe_tickets_pass_fees_to_user', [ $this, 'pass_fees_to_user' ], 10, 2 );
		add_filter( 'tribe_tickets_fee_percent', [ $this, 'get_fee_percent' ] );
		add_filter( 'tribe_tickets_fee_flat', [ $this, 'get_fee_flat' ] );

		add_filter( 'tribe_tickets_get_default_module', [ $this, 'filter_prevent_edd_provider' ] );

		add_action( 'admin_init', [ $this, 'run_updates' ], 10, 0 );
	}

Top ↑

Changelog #

Changelog
Version Description
4.7.0 Introduced.