From 578a5515e4c73bdc02d19f85fd31f634fd75ccb7 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 22 Jan 2016 17:30:10 -0200 Subject: [PATCH] Introduces the is_edit_account_page() function For #10103 --- includes/wc-conditional-functions.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/includes/wc-conditional-functions.php b/includes/wc-conditional-functions.php index b84fbe37805..37cb8921c25 100644 --- a/includes/wc-conditional-functions.php +++ b/includes/wc-conditional-functions.php @@ -170,6 +170,22 @@ if ( ! function_exists( 'is_view_order_page' ) ) { } } +if ( ! function_exists( 'is_edit_account_page' ) ) { + + /** + * Check for edit account page. + * Returns true when viewing the edit account page. + * + * @since 2.5.1 + * @return bool + */ + function is_edit_account_page() { + global $wp; + + return ( is_page( wc_get_page_id( 'myaccount' ) ) && isset( $wp->query_vars['edit-account'] ) ); + } +} + if ( ! function_exists( 'is_order_received_page' ) ) { /**