Tribe__Tickets__Attendees::register_page()

Registers the Attendees admin page

Contents


Source

File: src/Tribe/Attendees.php

	public function register_page() {
		$cap      = 'edit_posts';
		$event_id = absint( ! empty( $_GET['event_id'] ) && is_numeric( $_GET['event_id'] ) ? $_GET['event_id'] : 0 );

		if ( ! current_user_can( 'edit_posts' ) && $event_id ) {
			$event = get_post( $event_id );

			if ( $event instanceof WP_Post && get_current_user_id() === (int) $event->post_author ) {
				$cap = 'read';
			}
		}

		$this->page_id = add_submenu_page(
			null,
			'Attendee list',
			'Attendee list',
			$cap,
			$this->slug(),
			array( $this, 'render' )
		);

		/**
		 * @since 4.7.1
		 *
		 * @param string $page_id
		 */
		do_action( 'tribe_tickets_register_attendees_page', $this->page_id );

		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
		add_action( 'admin_enqueue_scripts', array( $this, 'load_pointers' ) );
		add_action( "load-{$this->page_id}", array( $this, 'screen_setup' ) );;
	}

Top ↑

Changelog

Changelog
Version Description
4.6.2 Introduced.