Tribe__Events__Aggregator__Record__Meetup::get_auth_url( array $args = array() )

Returns the Meetup authorization token generation URL.


Parameters #

$args

(array) (Optional)

Default value: array()


Top ↑

Return #

(string) Either the URL to obtain Eventbrite authorization token or an empty string.


Top ↑

Source #

File: src/Tribe/Aggregator/Record/Meetup.php

	public static function get_auth_url( $args = array() ) {
		$service = tribe( 'events-aggregator.service' );

		$api  = $service->api();
		if ( $api instanceof WP_Error ) {
			return '';
		}

		$key  = $api->key;
		$key2 = null;

		if ( ! empty( $api->licenses['tribe-meetup'] ) ) {
			$meetup_license = $api->licenses['tribe-meetup'];

			if ( empty( $key ) ) {
				$key = $meetup_license;
			} else {
				$key2 = $meetup_license;
			}
		}

		$url = $api->domain . 'meetup/' . $key;
		$defaults = array(
			'referral'  => urlencode( home_url() ),
			'admin_url' => urlencode( get_admin_url() ),
			'type'      => 'new',
			'lang'      => get_bloginfo( 'language' ),
		);

		if ( $key2 ) {
			$defaults['licenses'] = array(
				'tribe-meetup' => $key2,
			);
		}

		$args = wp_parse_args( $args, $defaults );

		$url = add_query_arg( $args, $url );

		return $url;
	}

Top ↑

Changelog #

Changelog
Version Description
4.9.6 Introduced.