Skip to content

Commit

Permalink
Add an early bail before setting password protected option if the fai…
Browse files Browse the repository at this point in the history
…led page is the checkout
  • Loading branch information
pattonwebz committed Jan 24, 2025
1 parent 053254d commit c805ef5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions includes/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ function edac_validate( $post_ID, $post, $action ) {
do_action( 'edac_after_get_content', $post_ID, $content, $action );

if ( ! $content['html'] ) {
// The woocommerse checkout page will always be a redirect when it has no items. The redirect
// will cause the content to be empty.
// TEMPORARY FIX: Just return without setting this as a password protected page. In future we
// will need to fix this properly by adding a product to the cart before checking.
if ( edac_check_if_post_id_is_woocommerse_checkout_page( $post_ID ) ) {
return;
}

update_option( 'edac_password_protected', true );
return;
} else {
Expand Down

0 comments on commit c805ef5

Please sign in to comment.