From 3e38d1ff172ba0daacb8646f685661f8e8692fac Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 12 Feb 2014 12:33:02 +0000 Subject: [PATCH] return a string for get_cart_url and get_remove_url Closes #4724 --- includes/class-wc-cart.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index dd59c1ac085..e43b0923354 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -580,10 +580,7 @@ class WC_Cart { */ public function get_cart_url() { $cart_page_id = wc_get_page_id( 'cart' ); - if ( $cart_page_id ) - return apply_filters( 'woocommerce_get_cart_url', get_permalink( $cart_page_id ) ); - - return ''; + return apply_filters( 'woocommerce_get_cart_url', $cart_page_id ? get_permalink( $cart_page_id ) : '' ); } /** @@ -611,8 +608,7 @@ class WC_Cart { */ public function get_remove_url( $cart_item_key ) { $cart_page_id = wc_get_page_id('cart'); - if ( $cart_page_id ) - return apply_filters( 'woocommerce_get_remove_url', wp_nonce_url( add_query_arg( 'remove_item', $cart_item_key, get_permalink( $cart_page_id ) ), 'woocommerce-cart' ) ); + return apply_filters( 'woocommerce_get_remove_url', $cart_page_id ? wp_nonce_url( add_query_arg( 'remove_item', $cart_item_key, get_permalink( $cart_page_id ) ), 'woocommerce-cart' ) : '' ); } /**