Merge pull request #23660 from gocodebox/master

add filter to allow disabling endpoint 404 behavior, per #23622
This commit is contained in:
Claudio Sanches 2019-05-10 12:50:29 -03:00 committed by GitHub
commit c96ed877af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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_endpoint_page_not_found', true ) ) {
$wp_query->set_404();
status_header( 404 );
include( get_query_template( '404' ) );