Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134807

jmerr59944 on "Text Change on Password Protected Page"

$
0
0

Hi,

Im using wordpress twentyten and I wanted to change the standard text displayed for a password protected page. I followed the directions for other posts and copied functions.php to my child theme and then edited it by adding the following code to the bottom of my functions.php file:

function my_password_form() {
global $post;
$label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
$output = '<div class="password-form">
<p class="protected-text">' . __('This post is password protected. To view it, please enter your password below:') . '</p>
<form action="' . get_option('siteurl') . '/wp-pass.php" method="post">
<p><label for="' . $label . '">' . __('Password:') . ' </label> <input name="post_password" id="' . $label . '" type="password" size="20" /> <input type="submit" name="submit" value="' . esc_attr__('Submit') . '" /></p></form></div>';
return $output;
}
add_filter('the_password_form','my_password_form');

It seemed to work fine and then I got a fatal error. What did I do wrong?

Jeremy
camptopeinu.com


Viewing all articles
Browse latest Browse all 134807

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>