[wp-trac] [WordPress Trac] #58610: Allow Custom CSS to Site Admins in Multisite

WordPress Trac noreply at wordpress.org
Fri Jun 23 14:01:05 UTC 2023


#58610: Allow Custom CSS to Site Admins in Multisite
-------------------------+-------------------------------------------------
 Reporter:  anrghg       |       Owner:  (none)
     Type:  defect       |      Status:  new
  (bug)                  |
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Customize    |     Version:
 Severity:  major        |  Resolution:
 Keywords:               |     Focuses:  ui, css, administration, multisite
-------------------------+-------------------------------------------------

Comment (by lenasterg):

 Don't do that.
 It would be better to have an option into the 'Network settings' admin
 page where each superadmin could select if he/she would allow the Custom
 CSS edit for the subsites.

 @anrghg If you need it for a project of yours, either install the plugin
 https://wordpress.org/plugins/multisite-custom-css/ or add the following
 code into your custom functions file.
 {{{#!php
 <?php
 add_filter( 'map_meta_cap', 'multisite_custom_css_map_meta_cap', 20, 2 );
 function multisite_custom_css_map_meta_cap( $caps, $cap ) {
         if ( 'edit_css' === $cap && is_multisite() ) {
                 $caps = array( 'edit_theme_options' );
         }
         return $caps;
 }

 }}}


 Bests,
 Lena

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58610#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list