How do I change just the password protected text – not the form
-
I have gone through the various available, mostly old, posts that show solutions to changing the password protected text but this one does not work with twenty thirteen:
function change_pw_text($content) { $content = str_replace( 'This content is password protected for Stratamp employees', $content); return $content; } add_filter('the_content','change_pw_text');
and this one works but disables the form’s functionality:
add_filter( 'the_password_form', 'custom_password_form' ); function custom_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"> ' . __( "<h1>Password Protected Page Content</h1>" ) . ' ' . __( "This post is password protected. To view it please enter your 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__( "Login" ) . '" /> </form> '; return $o;
I need to change this text “This post is password protected. To view it please enter your password below:” because the page is not a post.
I don’t need to change the form’s input field or its “Password” text and Submit button.
Charles
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How do I change just the password protected text – not the form’ is closed to new replies.