Permalink
Browse files

Fix problem with guests being unable to view receipts. #2101

  • Loading branch information...
1 parent e92e3a8 commit a45a2b3af2bef876e148fdd49d1a49492d0d145e @pippinsplugins pippinsplugins committed Mar 6, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 includes/shortcodes.php
@@ -496,7 +496,8 @@ function edd_receipt_shortcode( $atts, $content = null ) {
* Or if user is logged in and the user can view sensitive shop data
*
*/
- $user_can_view = ( is_user_logged_in() && $customer_id == get_current_user_id() ) || ( $customer_id == 0 && ! is_user_logged_in() && edd_get_purchase_session() ) || current_user_can( 'view_shop_sensitive_data' );
+
+ $user_can_view = ( is_user_logged_in() && $customer_id == get_current_user_id() ) || ( ( $customer_id == 0 || $customer_id == '-1' ) && ! is_user_logged_in() && edd_get_purchase_session() ) || current_user_can( 'view_shop_sensitive_data' );
if ( ! apply_filters( 'edd_user_can_view_receipt', $user_can_view, $edd_receipt_args ) ) {
return $edd_receipt_args[ 'error' ];

0 comments on commit a45a2b3

Please sign in to comment.