Hi,
I managed to resolve this another way, by adding a filter that gives the endpoint query var a value if present. Now you can check if that query var equals ‘true’ in the condition test.
add_filter( 'request', 'set_my_endpoint_value' );
function set_my_endpoint_value( $vars ) {
if ( isset( $vars[ 'endpoint' ] ) ) {
$vars[ 'endpoint' ] = 'true';
}
return $vars;
}