Custom Password Protected Form

This is some code that will help you to customize the password protected form.

 

// change password protected text

function my_password_form() {
global $post;
$label = ‘pwbox-‘.( empty( $post->ID ) ? rand() : $post->ID );
$o = __( “<p>In preparation for the Buying Summit we recommend you watch this incredible training from Matt Larson. This will give you a review of some essential strategies as well as introduce you to some critical skills to doing wholesale deals.</p><p>To access the video, enter your email address and the access code you’ve been given:</p>” ) .'<label>’ . __( “Email Address:” ) . ‘ </label><input name=”email” id=”Email” type=”email” size=”20″ /><form action=”‘ . esc_url( site_url( ‘wp-login.php?action=postpass’, ‘login_post’ ) ) . ‘” method=”post”>
<label for=”‘ . $label . ‘”>’ . __( “Access Code:” ) . ‘ </label><input name=”post_password” id=”‘ . $label . ‘” type=”password” size=”20″ /><br/><br/><input type=”submit” name=”Submit” value=”‘ . esc_attr__( “Submit” ) . ‘” />
</form>
‘;
return $o;
}
add_filter( ‘the_password_form’, ‘my_password_form’ );

//end change password protected text

Leave a Reply