add filter to allow disabling endpoint 404 behavior, per #23622
This commit is contained in:
parent
380ff713c2
commit
57bbcf94b7
|
@ -43,7 +43,7 @@ function wc_template_redirect() {
|
|||
}
|
||||
|
||||
// Trigger 404 if trying to access an endpoint on wrong page.
|
||||
if ( is_wc_endpoint_url() && ! is_account_page() && ! is_checkout() ) {
|
||||
if ( is_wc_endpoint_url() && ! is_account_page() && ! is_checkout() && apply_filters( 'woocommerce_account_endpoints_on_wrong_page_not_found', true ) ) {
|
||||
$wp_query->set_404();
|
||||
status_header( 404 );
|
||||
include( get_query_template( '404' ) );
|
||||
|
|
Loading…
Reference in New Issue