Change Wording for Password Page

WordPress-Christmas-11If you create a password protected page in WordPress, you have the standard sentence: “My post is password protected. Please ask me for a password:”. To change this sentence without losing the changes after the next upgrade, just place into the functions.php of your theme the following code:

function fb_the_password_form() {
	global $post;
	
	$label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
	$output = '

' . __("My post is password protected. Please ask me for a password:") . '

'; return $output; } add_filter('the_password_form', 'fb_the_password_form');

Just change the sentence in this code to your liking. That’s all. 🙂


Posted

in

by