• Thank you for your plugin.

    Please consider implementing do_not_allow override.

    Until then

    
    <?php
    /*
    Plugin Name: Themler for admins
    Description: Allow site administrators to edit themes.
    Version: 0.1.0
    */
    
    if ( ! defined( 'ABSPATH' ) ) {
        exit;
    }
    
    add_filter( 'map_meta_cap', 'itone_edit_themes_for_administrators', 10, 3 );
    
    function itone_edit_themes_for_administrators( $caps, $cap, $user_id ) {
    
        if ( 'edit_themes' === $cap ) {
            $user = get_userdata( $user_id );
    
            if ( in_array( 'administrator', $user->roles ) ) {
                $caps = array( 'edit_themes' );
            }
        }
    
        return $caps;
    }
    
  • The topic ‘Allow overrride do_not_allow in multisite’ is closed to new replies.