Make WordPress Core

Changeset 8946


Ignore:
Timestamp:
09/21/2008 09:10:14 PM (17 years ago)
Author:
westi
Message:

post password admin template tag.

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r8944 r8946  
    370370</p>
    371371<h4><?php _e( 'Post Password' ); ?></h4>
    372 <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>
     372<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>
    373373<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>
    374374<?php
  • trunk/wp-admin/edit-page-form.php

    r8893 r8946  
    217217<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>
    218218<h4><?php _e( 'Page Password' ); ?></h4>
    219 <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>
     219<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>
    220220<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>
    221221<?php
  • trunk/wp-admin/includes/template.php

    r8943 r8946  
    738738                    <div class="title"><?php _e('Password'); ?></div>
    739739                    <div class="in">
    740                     <input type="text" name="post_password" value="<?php echo $post->post_password ?>" />
     740                    <input type="text" name="post_password" value="<?php the_post_password(); ?>" />
    741741                    <label title="<?php _e('Privacy'); ?>">
    742742                    <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>
     
    23872387}
    23882388
     2389/**
     2390 * Display the post password.
     2391 *
     2392 * The password is passed through {@link attribute_escape()}
     2393 * to ensure that it is safe for placing in an html attribute.
     2394 *
     2395 * @uses attribute_escape
     2396 * @since 2.7.0
     2397 */
     2398function the_post_password() {
     2399    global $post;
     2400    if ( isset( $post->post_password ) ) echo attribute_escape( $post->post_password );
     2401}
    23892402?>
Note: See TracChangeset for help on using the changeset viewer.