Skip to content

Instantly share code, notes, and snippets.

@stefanledin
Created February 22, 2022 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanledin/f4586d3af4c1e0a9fe8da0bb3ee8214a to your computer and use it in GitHub Desktop.
Save stefanledin/f4586d3af4c1e0a9fe8da0bb3ee8214a to your computer and use it in GitHub Desktop.
<?php
add_filter( 'the_password_form', function( $output ) {
$input = '<input type="hidden" name="_wp_http_referer" value="'.get_permalink().'"></form>';
$output = str_replace( '</form>', $input, $output );
return $output;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment