Save and Continue - Password protected page - Blank Entries

I have an odd issue that had only just started happening. I have a password protected page and save and continue based form. It has always worked up until about a month ago.

Basically if the form is filled in and saved partially then accessed having typed the form password and pressed submit the form appears blank. If I take the password protection off the page and click the link the entries appear from the previous save?

P.s the is wordpress page password protection not gravity forms.

Any ideas how to fix this?

WordPress did make a breaking change to the post password functionality in the 6.8 update, so the query string used to access the page is not retained during the password submission process.

Try adding the following code to your theme functions.php file, a custom plugin, or a code snippets plugin.

add_filter( 'post_password_required', function( $required, $post ) {
    if ( $required && ! empty( $_GET ) ) {
       add_filter( 'page_link', function( $link, $post_id ) use ( $post ) {
          if ( $post->ID == $post_id ) {
             return add_query_arg( urlencode_deep( $_GET ), $link );
          }

          return $link;
       }, 10, 2 );
    }

    return $required;
}, 10, 2 );
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.