is_wc_endpoint_url()
Is_wc_endpoint_url - Check if an endpoint is showing.
No Hooks.
Return
true|false
.
Usage
is_wc_endpoint_url( $endpoint );
- $endpoint(string|false)
- Whether endpoint.
Default: false
is_wc_endpoint_url() is wc endpoint url code WC 9.4.2
function is_wc_endpoint_url( $endpoint = false ) { global $wp; $wc_endpoints = WC()->query->get_query_vars(); if ( false !== $endpoint ) { if ( ! isset( $wc_endpoints[ $endpoint ] ) ) { return false; } else { $endpoint_var = $wc_endpoints[ $endpoint ]; } return isset( $wp->query_vars[ $endpoint_var ] ); } else { foreach ( $wc_endpoints as $key => $value ) { if ( isset( $wp->query_vars[ $key ] ) ) { return true; } } return false; } }