Adding WP filter to is_order_received_page()

Many plugins and themes rely on is_order_received_page() to include special codes when the user places an order. Some plugins however alter the flow: Klarna checkout for example uses a completely custom checkout flow, some other plugins adds the option to the user to specify a WP page as "the" order received page instead of the WooCommerce default. All those plugins break codes where is_order_received_page() is being used.
This commit is contained in:
Thomas Geiger 2017-02-16 07:00:16 +01:00 committed by GitHub
parent 9b7395705a
commit 5f6295264d
1 changed files with 1 additions and 1 deletions

View File

@ -195,7 +195,7 @@ if ( ! function_exists( 'is_order_received_page' ) ) {
function is_order_received_page() {
global $wp;
return ( is_page( wc_get_page_id( 'checkout' ) ) && isset( $wp->query_vars['order-received'] ) );
return apply_filters( 'woocommerce_is_order_received_page', ( is_page( wc_get_page_id( 'checkout' ) ) && isset( $wp->query_vars['order-received'] ) ) );
}
}