Tribe__Events__Aggregator__Settings::is_ea_authorized_for_eb()

Check if the Eventbrite credentials are connected in EA

Contents


Return

(bool) Whether the Eventbrite credentials are valid


Top ↑

Source

File: src/Tribe/Aggregator/Settings.php

	public function is_ea_authorized_for_eb() {
		// if the service hasn't enabled oauth for Eventbrite, always assume it is valid
		if ( ! tribe( 'events-aggregator.main' )->api( 'origins' )->is_oauth_enabled( 'eventbrite' ) ) {
			return true;
		}

		$eb_authorized = tribe( 'events-aggregator.service' )->has_eventbrite_authorized();

		if ( empty( $eb_authorized->status ) || 'success' !== $eb_authorized->status ) {
			return false;
		}

		if ( ! $this->handle_eventbrite_security_key( $eb_authorized ) ) {
			return false;
		}

		return true;
	}