Make WordPress Core

Ticket #49268: 49268.patch

File 49268.patch, 913 bytes (added by rebasaurus, 5 years ago)

Since edit_themes cap is changed by the constant DISALLOW_FILE_MODS, we'll use edit_theme_options to remove the dependency as mentioned by @sorenbronsted

  • wp-admin/themes.php

    diff --git a/wp-admin/themes.php b/wp-admin/themes.php
    index 53bb1049a7..539495fd98 100644
    a b foreach ( $themes as $theme ) : 
    377377<?php
    378378// List broken themes, if any.
    379379$broken_themes = wp_get_themes( array( 'errors' => true ) );
    380 if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes ) {
     380if ( ! is_multisite() && $broken_themes ) {
    381381        ?>
    382382
    383383<div class="broken-themes">
    if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes ) { 
    388388        $can_resume  = current_user_can( 'resume_themes' );
    389389        $can_delete  = current_user_can( 'delete_themes' );
    390390        $can_install = current_user_can( 'install_themes' );
     391
     392        if ( defined( 'DISALLOW_FILE_MODS' ) && true === DISALLOW_FILE_MODS ) {
     393                $can_resume = $can_delete = $can_install = current_user_can( 'edit_theme_options' );
     394        }
    391395        ?>
    392396<table>
    393397        <tr>