tribe_events_get_url( string|array $query = array(), string|null $url = null )

Given a set of query strings returns the clean and canonical URL.


Parameters #

$query

(string|array) (Optional) Query string arguments.

Default value: array()

$url

(string|null) (Optional) Base url to apply those query arguments.

Default value: null


Top ↑

Return #

(string) Final clean and canonical URL for events.


Top ↑

Source #

File: src/functions/template-tags/url.php

function tribe_events_get_url( $query = [], $url = null ) {
	if ( empty( $url ) ) {
		$events_archive_base = tribe_get_option( 'eventsSlug', 'events' );
		$url = home_url( '/' . $events_archive_base );
	}

	return Rewrite::instance()->get_clean_url( add_query_arg( $query, $url ) );
}

Top ↑

Changelog #

Changelog
Version Description
4.9.4 Introduced.