[wp-trac] [WordPress Trac] #51093: Custom CSS output runs through the wrong filter for custom user role

WordPress Trac noreply at wordpress.org
Sat Aug 22 07:00:33 UTC 2020


#51093: Custom CSS output runs through the wrong filter for custom user role
--------------------------+---------------------
 Reporter:  kittmedia     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.5.1
Component:  Customize     |     Version:  5.5
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by kittmedia):

 You did all right! I missed some details, sorry for that …

 On a single site installation, it works fine as you also discovered. I can
 reproduce it in a clean multisite installation. To see the Custom CSS in
 the Customizer as “bob” you need to re-map the capability:

 {{{#!php
 <?php
 function map_css_cap( $caps, $cap ) {
         if ( 'edit_css' === $cap && is_multisite() ) {
                 $caps = array( 'import' );
         }
         return $caps;
 }

 add_filter( 'map_meta_cap', 'map_css_cap', 20, 2 );
 }}}

 If you then re-do what you did on the single site installation, it should
 produce the wrong CSS.

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


More information about the wp-trac mailing list