WordPress.org

Make WordPress Core

Ticket #11306: 11306-WP_CODE_EDITOR-constant.diff

File 11306-WP_CODE_EDITOR-constant.diff, 1.1 KB (added by nacin, 5 years ago)

define('WP_CODE_EDITOR', false) to force disabling of the theme and plugins editors.

  • wp-admin/plugin-editor.php

     
    99/** WordPress Administration Bootstrap */ 
    1010require_once('admin.php'); 
    1111 
    12 if ( !current_user_can('edit_plugins') ) 
     12if ( !current_user_can('edit_plugins') || ( defined('WP_CODE_EDITOR') && !WP_CODE_EDITOR ) ) 
    1313        wp_die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>'); 
    1414 
    1515$title = __("Edit Plugins"); 
  • wp-admin/theme-editor.php

     
    99/** WordPress Administration Bootstrap */ 
    1010require_once('admin.php'); 
    1111 
    12 if ( !current_user_can('edit_themes') ) 
     12if ( !current_user_can('edit_themes') || ( defined('WP_CODE_EDITOR') && !WP_CODE_EDITOR ) ) 
    1313        wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
    1414 
    1515$title = __("Edit Themes");