Title: function my_password_form()
Last modified: August 20, 2016

---

# function my_password_form()

 *  Resolved [rev.alice](https://wordpress.org/support/users/revalice/)
 * (@revalice)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/function-my_password_form/)
 * I’m sorry but i don’t have answer !
    I really need your help
 * I have a problem whith this fonction in version 3.5.1
 * —————————
    <?php function my_password_form() { global $post; $label = ‘pwbox-‘.(
   empty( $post->ID ) ? rand() : $post->ID ); $o = ‘<form class=”protected-post-
   form” action=”‘ . get_option( ‘siteurl’ ) . ‘/wp-pass.php” method=”post”> ‘ .
   __( “To view this protected post, enter the password below:” ) . ‘ <label for
   =”‘ . $label . ‘”>’ . __( “Password:” ) . ‘ </label><input name=”post_password”
   id=”‘ . $label . ‘” type=”password” size=”20″ /><input type=”submit” name=”Submit”
   value=”‘ . esc_attr__( “Submit” ) . ‘” /> </form> ‘; return $o; } add_filter(‘
   the_password_form’, ‘my_password_form’ ); ?> ————————— The text is changed, but
   when you enter the password and nothing ! You have an idea ? thanks for your 
   help !

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/function-my_password_form/#post-3457544)
 * the core function in /wp-includes/post-template.php (from line 1222) has changed;
 * try to use this code to change the words:
 *     ```
       function my_password_form() {
           global $post;
           $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
           $o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
           ' . __( "To view this protected post, enter the password below:" ) . '
           <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
           </form>
           ';
           return $o;
       }
       add_filter( 'the_password_form', 'my_password_form' );
       ```
   
 * here is a good post how to do chnage only the words without interfering with 
   the actual function: [http://diythemes.com/thesis/rtfm/password-protected-form/](http://diythemes.com/thesis/rtfm/password-protected-form/)
 *  Thread Starter [rev.alice](https://wordpress.org/support/users/revalice/)
 * (@revalice)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/function-my_password_form/#post-3457548)
 * Well done !!
    you are my hero for the day. Thank you so so much alchymyth !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘function my_password_form()’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [rev.alice](https://wordpress.org/support/users/revalice/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/function-my_password_form/#post-3457548)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
