public/wordpress/wp-content/plugins/wp-courseware/includes/functions/conditional.php
/**
 * Check if an endpoint is showing.
 *
 * @since 4.3.0
 *
 * @param string $endpoint Which endpoint to check, or any.
 *
 * @return bool True on successful check, false on failure.
 */
Check if an endpoint is showing.

@param string $endpoint Which endpoint to check, or any.

@return bool True on successful check, false on failure.
Check if an endpoint is showing . @param string $endpoint Which endpoint to check or any . @return bool True on successful check false on failure .
function wpcw_is_endpoint_url( $endpoint = false ) {
	global $wp;
	$endpoints = wpcw()->query->get_query_vars();
	if ( false !== $endpoint ) {
		if ( ! isset( $endpoints[ $endpoint ] ) ) {
			return false;
		} else {
			$endpoint_var = $endpoints[ $endpoint ];
		}
		return isset( $wp->query_vars[ $endpoint_var ] );
	}
	foreach ( $endpoints as $key => $value ) {
		if ( isset( $wp->query_vars[ $key ] ) ) {
			return true;
		}
	}
	return false;
}
function wpcw_is_endpoint_url ( $ endpoint = false ) { global $ wp ; $ endpoints = wpcw ( ) -> query -> get_query_vars ( ) ; if ( false !== $ endpoint ) { if ( ! isset ( $ endpoints [ $ endpoint ] ) ) { return false ; } else { $ endpoint_var = $ endpoints [ $ endpoint ] ; } return isset ( $ wp -> query_vars [ $ endpoint_var ] ) ; } foreach ( $ endpoints as $ key => $ value ) { if ( isset ( $ wp -> query_vars [ $ key ] ) ) { return true ; } } return false ; }
Check if an endpoint is showing.
Check if an endpoint is showing .