Ticket #37332: 37332-01.patch
File 37332-01.patch, 1.8 KB (added by , 9 years ago) |
---|
-
post-template.php
old new 1531 1531 function get_the_password_form( $post = 0 ) { 1532 1532 $post = get_post( $post ); 1533 1533 $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); 1534 $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> 1534 1535 // Display error message if post password is incorrect 1536 if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) ) 1537 echo '<p><strong>' . get_the_password_form_wrong_password() . '</strong></p>'; 1538 1539 $output .= '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> 1535 1540 <p>' . __( 'This content is password protected. To view it please enter your password below:' ) . '</p> 1536 1541 <p><label for="' . $label . '">' . __( 'Password:' ) . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr_x( 'Enter', 'post password form' ) . '" /></p></form> 1537 1542 '; … … 1548 1553 * @param string $output The password form HTML output. 1549 1554 */ 1550 1555 return apply_filters( 'the_password_form', $output ); 1556 } 1557 1558 /** 1559 * Displays message if incorrect password supplied on protected post. 1560 * 1561 * @since 4.5.2 1562 * 1563 * @return string HTML content for the error message if post password inputted incorrectly. 1564 */ 1565 function get_the_password_form_wrong_password() { 1566 1567 $output = esc_html_x('Wrong password. Please try again.', 'incorrect post password'); 1568 1569 /** 1570 * Filter the HTML output for the error message if post password inputted incorrectly. 1571 * 1572 * @since 4.5.2 1573 * 1574 * @param string $output The error message output. 1575 */ 1576 return apply_filters( 'the_password_form_wrong_password', $output ); 1551 1577 }