Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_the_password_form [ WordPress Function ]

get_the_password_form ( No parameters )
Uses:
Returns:
  • (string) HTML content for password form for password protected post.
Defined at:



Retrieve protected post password form content.

Source


<?php
function get_the_password_form() {
    global 
$post;
    
$label 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID );
    
$output '<form action="' esc_urlsite_url'wp-login.php?action=postpass''login_post' ) ) . '" method="post">
    <p>' 
__("This post is password protected. To view it please enter your password below:") . '</p>
    <p><label for="' 
$label '">' __("Password:") . ' <input name="post_password" id="' $label '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' esc_attr__("Submit") . '" /></p>
    </form>
    '
;
    return 
apply_filters('the_password_form'$output);
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics