luizbills / wp-tweaks

Several opinionated wordpress tweaks focused in :shield: security and :zap: performance.
https://wordpress.org/plugins/wp-tweaks/
GNU General Public License v3.0
31 stars 8 forks source link

Multisite Bug #19

Closed akissz closed 2 years ago

akissz commented 3 years ago

When you enable the plugin on a network multisite wordpress configuration. The options are all on but not visible to change even on the main site. So you can not use the plugin editor due to the option "Disallow file edit" being enabled by default which is a problem for the main site. So can you make the plugin show settings for the main site on a network multisite wordpress configuration. Please!

Its not a big problem. But it is a little strange. :)

luizbills commented 3 years ago

Hi @akissz I tried to reproduce this bug in my local workspace but it worked perfectly. I configured each site without any problems.

akissz commented 3 years ago

Hi @akissz I tried to reproduce this bug in my local workspace but it worked perfectly. I configured each site without any problems.

Maybe you didn't understand this bug. This bug is not about the "sites" added. The point is the setting to edit files should be enabled for the main admin account; meaning the super user should be able to edit files, or the feature should be available to turn on the feature.

luizbills commented 3 years ago

Oh my bad, I understand now.

When that option is disabled only the multisite panel can edit files (no child will be able to edit). So you can just leave it disabled or put the following snippet in your theme's functions.php:

add_action( 'init', function () {
    if ( current_user_can( 'install_plugins' ) ) {
        remove_action( 'init', 'wp_tweaks_disallow_file_edit' );
    }
}, 5 );