Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2. add_filter( 'the_password_form', 'custom_password_form' );
  3. function custom_password_form() {
  4.     global $post;
  5.     $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
  6.     $o = '<form class="protected-post-form" action="' . get_option('siteurl') . '/wp-pass.php" method="post">
  7.     ' . __( "This post is password protected.  More than likely it is password protected because it is a free gift for people who subscribe to my newsletter.  <a href=\"#newslettersubscribe\">newsletter</a>") . '
  8.     <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
  9.     </form>
  10.     ';
  11.     return $o;
  12. }
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement