Merge pull request #7022 from bryceadams/patch-7018

New `is_view_order_page` conditional function
This commit is contained in:
Mike Jolley 2014-12-30 14:46:48 +00:00
commit 2a7c9c731d
1 changed files with 16 additions and 1 deletions

View File

@ -7,7 +7,7 @@
* @author WooThemes
* @category Core
* @package WooCommerce/Functions
* @version 2.1.0
* @version 2.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -178,6 +178,21 @@ if ( ! function_exists( 'is_account_page' ) ) {
}
}
if ( ! function_exists( 'is_view_order_page' ) ) {
/**
* is_view_order_page - Returns true when on the view order page.
*
* @access public
* @return bool
*/
function is_view_order_page() {
global $wp;
return ( is_page( wc_get_page_id( 'myaccount' ) ) && isset( $wp->query_vars['view-order'] ) ) ? true : false;
}
}
if ( ! function_exists( 'is_order_received_page' ) ) {
/**