diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index c977df6324..ae212c7166 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -146,12 +146,13 @@ switch ( $post->post_status ) {
post_password ) ) { - $visibility = 'password'; - $visibility_trans = __('Password protected'); -} elseif ( 'private' == $post->post_status ) { +if ( 'private' == $post->post_status ) { + $post->post_password = ''; $visibility = 'private'; $visibility_trans = __('Private'); +} elseif ( !empty( $post->post_password ) ) { + $visibility = 'password'; + $visibility_trans = __('Password protected'); } elseif ( is_sticky( $post->ID ) ) { $visibility = 'public'; $visibility_trans = __('Public, Sticky'); diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index 4313e9c661..f4d98fe995 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -141,12 +141,13 @@ switch ( $post->post_status ) {
post_password ) ) { - $visibility = 'password'; - $visibility_trans = __('Password protected'); -} elseif ( 'private' == $post->post_status ) { +if ( 'private' == $post->post_status ) { + $post->post_password = ''; $visibility = 'private'; $visibility_trans = __('Private'); +} elseif ( !empty( $post->post_password ) ) { + $visibility = 'password'; + $visibility_trans = __('Password protected'); } else { $visibility = 'public'; $visibility_trans = __('Public'); diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 219eefc2d9..d427389242 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1011,8 +1011,10 @@ function inline_edit_row( $type ) { + +
@@ -3248,7 +3250,7 @@ function _post_states($post) { $post_status = ''; if ( !empty($post->post_password) ) - $post_states[] = __('Protected'); + $post_states[] = __('Password protected'); if ( 'private' == $post->post_status && 'private' != $post_status ) $post_states[] = __('Private'); if ( 'draft' == $post->post_status && 'draft' != $post_status ) diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js index 3a19004dc9..88163504e8 100644 --- a/wp-admin/js/inline-edit-post.js +++ b/wp-admin/js/inline-edit-post.js @@ -21,6 +21,15 @@ inlineEditPost = { $('a.cancel', bulkRow).click(function() { return inlineEditPost.revert(); }); + $('#inline-edit .inline-edit-private input[value=private]').click( function(){ + var pw = $('input.inline-edit-password-input'); + if ( $(this).attr('checked') ) { + pw.val('').attr('disabled', 'disabled'); + } else { + pw.attr('disabled', ''); + } + }); + // add events t.addEvents(t.rows); @@ -146,7 +155,10 @@ inlineEditPost = { // handle the post status var status = $('._status', rowData).text(); if ( status != 'future' ) $('select[name="_status"] option[value="future"]', editRow).remove(); - if ( status == 'private' ) $('input[name="keep_private"]', editRow).attr("checked", "checked"); + if ( status == 'private' ) { + $('input[name="keep_private"]', editRow).attr("checked", "checked"); + $('input.inline-edit-password-input').val('').attr('disabled', 'disabled'); + } // remove the current page and children from the parent dropdown var pageOpt = $('select[name="post_parent"] option[value="'+id+'"]', editRow); diff --git a/wp-includes/post.php b/wp-includes/post.php index 8e1451cbda..4df56bb462 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1422,7 +1422,7 @@ function wp_insert_post($postarr = array(), $wp_error = false) { else $menu_order = 0; - if ( !isset($post_password) ) + if ( !isset($post_password) || 'private' == $post_status ) $post_password = ''; if ( !in_array( $post_status, array( 'draft', 'pending' ) ) ) { diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 2fe832046e..3d48841a0e 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -250,7 +250,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); - $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081129' ); + $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081206' ); $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( 'error' => __('Error while saving the changes.'), 'ntdeltitle' => __('Remove From Bulk Edit'),