Password hint for protected page
-
Hello,
I make a page protected by a password.
I want to modify the form so, when the user enter the wrong password
he will get an error message instead of a page refresh….Here’s the form:
<?php
function fb_the_password_form() {
global $post;
$label = ‘pwbox-‘.(empty($post->ID) ? rand() : $post->ID);
$output = ‘<form action=”‘ . get_option(‘siteurl’) . ‘/wp-pass.php” method=”post”>
<p>’ . __(“My post is password protected. Please ask me for a password:”) . ‘</p>
<p><label for=”‘ . $label . ‘”>’ . __(“Password”) . ‘ <input name=”post_password” id=”‘ . $label . ‘” type=”password” size=”20″ /></label> <input type=”submit” name=”Submit” value=”‘ . esc_attr__(“Submit”) . ‘” /></p>
</form>’;
return $output;
}
add_filter(‘the_password_form’, ‘fb_the_password_form’);
?>
- The topic ‘Password hint for protected page’ is closed to new replies.