Make WordPress Core

Ticket #8433: 8433.diff

File 8433.diff, 1.8 KB (added by Denis-de-Bernardy, 17 years ago)
  • wp-admin/user-edit.php

     
    1414else
    1515        $is_profile_page = false;
    1616
     17$all_post_types = apply_filters('all_post_types', array('post', 'page'));
     18$user_can_edit = false;
     19foreach ( $all_post_types as $post_type )
     20        $user_can_edit |= current_user_can("edit_$post_type");
     21
    1722/**
    1823 * Display JavaScript for profile page.
    1924 *
     
    200205<h3><?php _e('Personal Options'); ?></h3>
    201206
    202207<table class="form-table">
    203 <?php if ( rich_edit_exists() ) : // don't bother showing the option if the editor has been removed ?>
     208<?php if ( rich_edit_exists() && !( $is_profile_page && !$user_can_edit ) ) : // don't bother showing the option if the editor has been removed ?>
    204209        <tr>
    205210                <th scope="row"><?php _e('Visual Editor')?></th>
    206211                <td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked('false', $profileuser->rich_editing); ?> /> <?php _e('Disable the visual editor when writing'); ?></label></td>
     
    229234        <?php endforeach; ?>
    230235</fieldset></td>
    231236</tr>
     237<?php if ( !( $is_profile_page && !$user_can_edit ) ) : ?>
    232238<tr>
    233239<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
    234240<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">More information</a>'); ?></td>
    235241</tr>
    236242<?php
    237243endif;
     244endif;
    238245do_action('personal_options', $profileuser);
    239246?>
    240247</table>