Make WordPress Core

Changeset 10088


Ignore:
Timestamp:
12/06/2008 11:10:24 AM (18 years ago)
Author:
markjaquith
Message:

Make Password protected and private mutually exclusive when using Quick Edit.

Location:
trunk
Files:
6 edited

Legend:

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

    r9956 r10088  
    147147<?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
    148148
    149 if ( !empty( $post->post_password ) ) {
     149if ( 'private' == $post->post_status ) {
     150        $post->post_password = '';
     151        $visibility = 'private';
     152        $visibility_trans = __('Private');
     153} elseif ( !empty( $post->post_password ) ) {
    150154        $visibility = 'password';
    151155        $visibility_trans = __('Password protected');
    152 } elseif ( 'private' == $post->post_status ) {
    153         $visibility = 'private';
    154         $visibility_trans = __('Private');
    155156} elseif ( is_sticky( $post->ID ) ) {
    156157        $visibility = 'public';
  • trunk/wp-admin/edit-page-form.php

    r9996 r10088  
    142142<?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
    143143
    144 if ( !empty( $post->post_password ) ) {
     144if ( 'private' == $post->post_status ) {
     145        $post->post_password = '';
     146        $visibility = 'private';
     147        $visibility_trans = __('Private');
     148} elseif ( !empty( $post->post_password ) ) {
    145149        $visibility = 'password';
    146150        $visibility_trans = __('Password protected');
    147 } elseif ( 'private' == $post->post_status ) {
    148         $visibility = 'private';
    149         $visibility_trans = __('Private');
    150151} else {
    151152        $visibility = 'public';
  • trunk/wp-admin/includes/template.php

    r10082 r10088  
    10121012                        </label>
    10131013
     1014                        <em style="margin:5px 10px 0 0" class="alignleft"><?php echo _c( '&ndash;OR&ndash;|Between password field and private checkbox on post quick edit interface' ); ?></em>
     1015
    10141016                        <label class="alignleft inline-edit-private">
    1015                                 <input type="checkbox" name="keep_private" value="private" <?php checked($post->post_status, 'private'); ?> />
     1017                                <input type="checkbox" name="keep_private" value="private" />
    10161018                                <span class="checkbox-title"><?php echo $is_page ? __('Private page') : __('Private post'); ?></span>
    10171019                        </label>
     
    32493251
    32503252        if ( !empty($post->post_password) )
    3251                 $post_states[] = __('Protected');
     3253                $post_states[] = __('Password protected');
    32523254        if ( 'private' == $post->post_status && 'private' != $post_status )
    32533255                $post_states[] = __('Private');
  • trunk/wp-admin/js/inline-edit-post.js

    r9973 r10088  
    2121
    2222                $('a.cancel', bulkRow).click(function() { return inlineEditPost.revert(); });
     23
     24                $('#inline-edit .inline-edit-private input[value=private]').click( function(){
     25                        var pw = $('input.inline-edit-password-input');
     26                        if ( $(this).attr('checked') ) {
     27                                pw.val('').attr('disabled', 'disabled');
     28                        } else {
     29                                pw.attr('disabled', '');
     30                        }
     31                });
    2332
    2433                // add events
     
    147156                var status = $('._status', rowData).text();
    148157                if ( status != 'future' ) $('select[name="_status"] option[value="future"]', editRow).remove();
    149                 if ( status == 'private' ) $('input[name="keep_private"]', editRow).attr("checked", "checked");
     158                if ( status == 'private' ) {
     159                        $('input[name="keep_private"]', editRow).attr("checked", "checked");
     160                        $('input.inline-edit-password-input').val('').attr('disabled', 'disabled');
     161                }
    150162
    151163                // remove the current page and children from the parent dropdown
  • trunk/wp-includes/post.php

    r10070 r10088  
    14231423                $menu_order = 0;
    14241424
    1425         if ( !isset($post_password) )
     1425        if ( !isset($post_password) || 'private' == $post_status )
    14261426                $post_password = '';
    14271427
  • trunk/wp-includes/script-loader.php

    r10075 r10088  
    251251                $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' );
    252252
    253                 $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081129' );
     253                $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081206' );
    254254                $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
    255255                        'error' => __('Error while saving the changes.'),
Note: See TracChangeset for help on using the changeset viewer.