我只想在这个密码保护功能的内容上方添加一个H2或任何html标记。这是正确的吗?
function my_password_form() {
global $post;
$label = \'pwbox-\'.( empty( $post->ID ) ? rand() : $post->ID );
$o = \'<h2><br>Password Protected Area</h2><form action="\' . esc_url( site_url( \'wp-login.php?action=postpass\', \'login_post\' ) ) . \'" method="post">
\' . __( "This content is password protected. If you are media requiring access please contact our Press Office, [email protected] and they will be happy to assist you." ) . \'
<label for="\' . $label . \'">\' . __( "Password:" ) . \' </label><input name="post_password" id="\' . $label . \'" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="\' . esc_attr__( "Submit" ) . \'" />
</form>
\';
return $o;
}
add_filter( \'the_password_form\', \'my_password_form\' );