WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How & where to change Password Protect HTML code... (4 posts)

  1. JohnMiltonFogg
    Member
    Posted 4 years ago #

    I'm looking for the ftp (?) page where I can change "Submit" to "Send" and add a line space to the Password Form. I can see the code from the Page Source View:

    <form action="http://thegreatestnetworker.org/wp-pass.php" method="post">

    <p>This post is password protected. To view it please enter your password below:</p>
    <p><label for="pwbox-131">Password:
    <input name="post_password" id="pwbox-131" type="password" size="20" /></label>
    <input type="submit" name="Submit" value="Submit" /></p></form>

    BUT, like Little BoPeep, I have no idea where to find them...

    Thanks for your help.
    I appreciate you.

  2. JohnMiltonFogg
    Member
    Posted 4 years ago #

    Still hoping (praying, pleading...) for an answer to this one. I HAVE looked almost everywhere— almost 'cause if I'd been in the right place... never mind.

    Help!

  3. MichaelH
    Member
    Posted 4 years ago #

    Using http://wingrep.com on a locally residing copy of WordPress, searched for the text "This post is password protected" and found that in wp-includes/post-template.php

    But that code also provides a filter -- meaning a plugin could be created to change that.

    return apply_filters('the_password_form', $output);

    Unless you do something like a plugin, note that changing core code means you will need to make changes in subsequent WordPress update.

  4. MichaelH
    Member
    Posted 4 years ago #

    Just for grins this does add another line after the below: text:

    <?php
    function modify_password_form($output) {
    
      if ( !$output ) return; // just in case nothing there
        $b = strpos($output, '</p>');
        $output = substr($output,0,$b+4) . "<p>&nbsp;</p>" . substr($output,$b+6);
      return $output;
    	}
    add_action('the_password_form', 'modify_password_form');
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic