Tribe__Tickets__Metabox::user_can( string $generic_cap, int $attendee_id )

Tests if the user has the specified capability in relation to whatever post type the attendee object relates to.

For example, if the attendee was generated for a ticket set up in relation to a post of the banana type, the generic capability "edit_posts" will be mapped to "edit_bananas" or whatever is appropriate.

See also

  • tribe(: ‘tickets.attendees’ )->user_can

Top ↑

Parameters

$generic_cap

(string) (Required)

$attendee_id

(int) (Required)


Top ↑

Return

(boolean)


Top ↑

Source

File: src/Tribe/Metabox.php

	public function user_can( $generic_cap, $attendee_id ) {
		$connections = tribe( 'tickets.handler' )->get_object_connections( $attendee_id );

		if ( ! $connections->event ) {
			return false;
		}

		return tribe( 'tickets.attendees' )->user_can( $generic_cap, $connections->event );
	}

Top ↑

Changelog

Changelog
Version Description
4.6.2 Introduced.