You appear to be a bot. Output may be restricted
Description
Retrieve protected post password form content.
Usage
$string = twenty_twenty_one_password_form( $output, $post );
Parameters
- $output
- ( string ) required – The password form HTML output.
- $post
- ( int|WP_Post ) optional – Optional. Post ID or WP_Post object. Default is global $post.
Returns
string HTML content for password form for password protected post.
Source
File name: twentytwentyone/inc/template-functions.php
Lines:
1 to 11 of 11
function twenty_twenty_one_password_form( $output, $post = 0 ) { $post = get_post( $post ); $label = 'pwbox-' . ( empty( $post->ID ) ? wp_rand() : $post->ID ); $output = '<p class="post-password-message">' . esc_html__( 'This content is password protected. Please enter a password to view.', 'twentytwentyone' ) . '</p> <form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> <label class="post-password-form__label" for="' . esc_attr( $label ) . '">' . esc_html_x( 'Password', 'Post password form', 'twentytwentyone' ) . '</label><input class="post-password-form__input" name="post_password" id="' . esc_attr( $label ) . '" type="password" spellcheck="false" size="20" /><input type="submit" class="post-password-form__submit" name="' . esc_attr_x( 'Submit', 'Post password form', 'twentytwentyone' ) . '" value="' . esc_attr_x( 'Enter', 'Post password form', 'twentytwentyone' ) . '" /></form> '; return $output; }