WordPress.org

Make WordPress Core

Changeset 13034


Ignore:
Timestamp:
02/09/2010 12:07:52 AM (8 years ago)
Author:
ryan
Message:

Introduce DISALLOW_FILE_EDIT flag for enabling/disabling the theem and plugin editors. Props nacin. see #11306

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r12796 r13034  
    976976        break;
    977977    case 'unfiltered_upload':
    978         if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS == true && ( !is_multisite() || is_super_admin() )  )
     978        if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin() )  )
    979979            $caps[] = $cap;
    980980        else
    981981            $caps[] = 'do_not_allow';
    982982        break;
     983    case 'edit_plugins':
     984    case 'edit_themes':
     985        if ( defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT ) {
     986            $caps[] = 'do_not_allow';
     987            break;
     988        }
     989        // Fall through if not DISALLOW_FILE_EDIT.
    983990    case 'unfiltered_html':
    984991    case 'update_plugins':
    985992    case 'delete_plugins':
    986993    case 'install_plugins':
    987     case 'edit_plugins':
    988994    case 'update_themes':
    989995    case 'install_themes':
    990     case 'edit_themes':
    991996    case 'update_core':
    992997    case 'delete_user':
Note: See TracChangeset for help on using the changeset viewer.