• Resolved rev.alice

    (@revalice)


    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)
  • 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/

    Thread Starter rev.alice

    (@revalice)

    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.