Created
April 28, 2020 07:41
-
-
Save vladutilie/4c9d53387971e6ea0a32f3cf2cf6ca80 to your computer and use it in GitHub Desktop.
Change WordPress password form post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('the_password_form', 'change_password_form_text' ); | |
function change_password_form_text( $post = 0 ) { | |
$post = get_post( $post ); | |
$label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID ); | |
$output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> | |
<p>' . __( 'Here is your text:', 'textdomain' ) . '</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_x( 'Enter', 'post password form' ) . '" /></p></form>'; | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment