public/wordpress/wp-content/plugins/wp-courseware/includes/functions/core.php
/**
 * Get Endpoint Url
 *
 * Gets the URL for an endpoint, which varies depending on permalink settings.
 *
 * @since 4.3.0
 *
 * @param string $endpoint The endpoint slug.
 * @param string $value The query param value.
 * @param string $permalink The permalink.
 *
 * @return string The endpoint url.
 */
Get Endpoint Url
Gets the URL for an endpoint, which varies depending on permalink settings.



@param string $endpoint The endpoint slug.
@param string $value The query param value.
@param string $permalink The permalink.

@return string The endpoint url.
Get Endpoint Url Gets the URL for an endpoint which varies depending on permalink settings . @param string $endpoint The endpoint slug . @param string $value The query param value . @param string $permalink The permalink . @return string The endpoint url .
function wpcw_get_endpoint_url( $endpoint, $value = '', $permalink = '' ) {
	if ( ! $permalink ) {
		$permalink = get_permalink();
	}
	$query_vars = wpcw()->query->get_query_vars();
	$endpoint   = ! empty( $query_vars[ $endpoint ] ) ? $query_vars[ $endpoint ] : $endpoint;
	if ( get_option( 'permalink_structure' ) ) {
		if ( strstr( $permalink, '?' ) ) {
			$query_string = '?' . wp_parse_url( $permalink, PHP_URL_QUERY );
			$permalink    = current( explode( '?', $permalink ) );
		} else {
			$query_string = '';
		}
		$url = trailingslashit( $permalink ) . trailingslashit( $endpoint );
		if ( $value ) {
			$url .= trailingslashit( $value );
		}
		$url .= $query_string;
	} else {
		$url = add_query_arg( $endpoint, $value, $permalink );
	}
	return apply_filters( 'wpcw_get_endpoint_url', $url, $endpoint, $value, $permalink );
}
function wpcw_get_endpoint_url ( $ endpoint , $ value = '' , $ permalink = '' ) { if ( ! $ permalink ) { $ permalink = get_permalink ( ) ; } $ query_vars = wpcw ( ) -> query -> get_query_vars ( ) ; $ endpoint = ! empty ( $ query_vars [ $ endpoint ] ) ? $ query_vars [ $ endpoint ] : $ endpoint ; if ( get_option ( 'permalink_structure' ) ) { if ( strstr ( $ permalink , '?' ) ) { $ query_string = '?' . wp_parse_url ( $ permalink , PHP_URL_QUERY ) ; $ permalink = current ( explode ( '?' , $ permalink ) ) ; } else { $ query_string = '' ; } $ url = trailingslashit ( $ permalink ) . trailingslashit ( $ endpoint ) ; if ( $ value ) { $ url .= trailingslashit ( $ value ) ; } $ url .= $ query_string ; } else { $ url = add_query_arg ( $ endpoint , $ value , $ permalink ) ; } return apply_filters ( 'wpcw_get_endpoint_url' , $ url , $ endpoint , $ value , $ permalink ) ; }
Get Endpoint Url
 Gets the URL for an endpoint, which varies depending on permalink settings.
Get Endpoint Url Gets the URL for an endpoint which varies depending on permalink settings .