Make WordPress Core

Ticket #22164: 22164.patch

File 22164.patch, 6.3 KB (added by SergeyBiryukov, 12 years ago)
  • wp-admin/admin-ajax.php

     
    4949        'delete-meta', 'delete-post', 'trash-post', 'untrash-post', 'delete-page', 'dim-comment',
    5050        'add-link-category', 'add-tag', 'get-tagcloud', 'get-comments', 'replyto-comment',
    5151        'edit-comment', 'add-menu-item', 'add-meta', 'add-user', 'autosave', 'closed-postboxes',
    52         'hidden-columns', 'update-welcome-panel', 'menu-get-metabox', 'wp-link-ajax',
     52        'hidden-columns', 'comment-shortcuts', 'update-welcome-panel', 'menu-get-metabox', 'wp-link-ajax',
    5353        'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink',
    5454        'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order',
    5555        'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',
  • wp-admin/includes/ajax-actions.php

     
    11691169        wp_die( 1 );
    11701170}
    11711171
     1172/**
     1173 * Save Keyboard Shortcuts user option.
     1174 *
     1175 * @since 3.5.0
     1176 */
     1177function wp_ajax_comment_shortcuts() {
     1178        check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
     1179
     1180        if ( ! current_user_can( 'moderate_comments' ) )
     1181                wp_die( -1 );
     1182
     1183        update_user_meta( get_current_user_id(), 'comment_shortcuts', empty( $_POST['comment_shortcuts'] ) ? 'false' : 'true' );
     1184
     1185        wp_die( 1 );
     1186}
     1187
    11721188function wp_ajax_update_welcome_panel() {
    11731189        check_ajax_referer( 'welcome-panel-nonce', 'welcomepanelnonce' );
    11741190
  • wp-admin/includes/screen.php

     
    901901                $this->_screen_settings = apply_filters( 'screen_settings', '', $this );
    902902
    903903                switch ( $this->id ) {
     904                        case 'edit-comments':
     905                                $current_user = wp_get_current_user();
     906                                $this->_screen_settings = '<h5>' . __( 'Keyboard Shortcuts' ) . '</h5>'
     907                                        . '<p><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" ' . ( ! empty( $current_user->comment_shortcuts ) ? checked( 'true', $current_user->comment_shortcuts, false ) : '' ) . ' />'
     908                                        . __( 'Enable keyboard shortcuts for comment moderation.' ) . '</label> ' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>' ) . "</p>\n";
     909                                break;
    904910                        case 'widgets':
    905911                                $this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
    906912                                break;
  • wp-admin/includes/user.php

     
    9696                $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false';
    9797        }
    9898
    99         $user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
    100 
    10199        $user->use_ssl = 0;
    102100        if ( !empty($_POST['use_ssl']) )
    103101                $user->use_ssl = 1;
  • wp-admin/js/edit-comments.js

     
    601601                        prev_page_link_cb: make_hotkeys_redirect('prev'), next_page_link_cb: make_hotkeys_redirect('next') }
    602602                );
    603603        }
     604
     605        $('#comment_shortcuts').change( function() {
     606                $.post( ajaxurl, {
     607                        action: 'comment-shortcuts',
     608                        comment_shortcuts: this.checked ? 1 : 0,
     609                        screenoptionnonce: $('#screenoptionnonce').val()
     610                });
     611        });
    604612});
    605613
    606614})(jQuery);
  • wp-admin/user-edit.php

     
    3737        $parent_file = 'profile.php';
    3838
    3939$profile_help = '<p>' . __('Your profile contains information about you (your &#8220;account&#8221;) as well as some personal options related to using WordPress.') . '</p>' .
    40         '<p>' . __('You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.') . '</p>' .
     40        '<p>' . __('You can change your password, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.') . '</p>' .
    4141        '<p>' . __('Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.') . '</p>' .
    4242        '<p>' . __('Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.') . '</p>' .
    4343        '<p>' . __('Remember to click the Update Profile button when you are finished.') . '</p>';
     
    213213<th scope="row"><?php _e('Admin Color Scheme')?></th>
    214214<td><?php do_action( 'admin_color_scheme_picker' ); ?></td>
    215215</tr>
    216 <?php
    217 endif; // $_wp_admin_css_colors
    218 if ( !( IS_PROFILE_PAGE && !$user_can_edit ) ) : ?>
    219 <tr>
    220 <th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
    221 <td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty($profileuser->comment_shortcuts) ) checked('true', $profileuser->comment_shortcuts); ?> /> <?php _e('Enable keyboard shortcuts for comment moderation.'); ?></label> <?php _e('<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>'); ?></td>
    222 </tr>
    223 <?php endif; ?>
     216<?php endif; // $_wp_admin_css_colors ?>
    224217<tr class="show-admin-bar">
    225218<th scope="row"><?php _e('Toolbar')?></th>
    226219<td><fieldset><legend class="screen-reader-text"><span><?php _e('Toolbar') ?></span></legend>