post password admin template tag.

git-svn-id: https://develop.svn.wordpress.org/trunk@8946 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-09-21 21:10:14 +00:00
parent b9770c6ca8
commit 2e29e004d2
3 changed files with 16 additions and 3 deletions

View File

@ -369,7 +369,7 @@ function post_password_meta_box($post) {
<label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label>
</p>
<h4><?php _e( 'Post Password' ); ?></h4>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php if ( isset( $post->post_password ) ) echo attribute_escape( $post->post_password ); ?>" /></p>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
<?php
}

View File

@ -216,7 +216,7 @@ function page_password_meta_box($post){
?>
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
<h4><?php _e( 'Page Password' ); ?></h4>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo ( isset( $post->post_password ) ? attribute_escape( $post->post_password ) : '' ); ?>" /></p>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
<?php
}

View File

@ -737,7 +737,7 @@ function inline_edit_row( $type ) {
<div class="password quick-edit-div" title="<?php _e('Password'); ?>">
<div class="title"><?php _e('Password'); ?></div>
<div class="in">
<input type="text" name="post_password" value="<?php echo $post->post_password ?>" />
<input type="text" name="post_password" value="<?php the_post_password(); ?>" />
<label title="<?php _e('Privacy'); ?>">
<input type="checkbox" name="keep_private" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php echo $is_page ? __('Keep this page private') : __('Keep this post private'); ?></label>
</div>
@ -2386,4 +2386,17 @@ function find_posts_div($found_action = '') {
<?php
}
/**
* Display the post password.
*
* The password is passed through {@link attribute_escape()}
* to ensure that it is safe for placing in an html attribute.
*
* @uses attribute_escape
* @since 2.7.0
*/
function the_post_password() {
global $post;
if ( isset( $post->post_password ) ) echo attribute_escape( $post->post_password );
}
?>