Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_View_Manager::get_url( string $role, array $args = array() )

Get a view url for the requested view


Description Description


Parameters Parameters

$role

(string) (Required) view option [self|visitor|student]

$args

(array) (Optional) additional query args to add to the url

Default value: array()


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class.llms.view.manager.php

	private function get_url( $role, $args = array() ) {

		global $post;
		$permalink = get_permalink( $post->ID );

		if ( 'self' === $role ) {
			return $permalink;
		}

		$args['llms-view-as'] = $role;

		$href = add_query_arg( $args, $permalink );
		$href = wp_nonce_url( $href, 'llms-view-as', 'view_nonce' );

		return $href;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.7.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.