Make WordPress Core

Ticket #38672: 38672.diff

File 38672.diff, 2.4 KB (added by lukecavanagh, 8 years ago)

Basic patch for edit_css

  • wp-includes/capabilities.php

     
    320320                else
    321321                        $caps[] = 'do_not_allow';
    322322                break;
    323         case 'unfiltered_css' :
     323        case 'edit_css' :
    324324        case 'unfiltered_html' :
    325325                // Disallow unfiltered_html for all users, even admins and super admins.
    326326                if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML )
  • wp-includes/class-wp-customize-manager.php

     
    35983598                ) );
    35993599
    36003600                $custom_css_setting = new WP_Customize_Custom_CSS_Setting( $this, sprintf( 'custom_css[%s]', get_stylesheet() ), array(
    3601                         'capability' => 'unfiltered_css',
     3601                        'capability' => 'edit_css',
    36023602                        'default' => sprintf( "/*\n%s\n*/", __( "You can add your own CSS here.\n\nClick the help icon above to learn more." ) ),
    36033603                ) );
    36043604                $this->add_setting( $custom_css_setting );
  • wp-includes/customize/class-wp-customize-custom-css-setting.php

     
    4646         *
    4747         * @var string
    4848         */
    49         public $capability = 'unfiltered_css';
     49        public $capability = 'edit_css';
    5050
    5151        /**
    5252         * Stylesheet
  • wp-includes/post.php

     
    140140                        'delete_published_posts' => 'edit_theme_options',
    141141                        'delete_private_posts'   => 'edit_theme_options',
    142142                        'delete_others_posts'    => 'edit_theme_options',
    143                         'edit_post'              => 'unfiltered_css',
    144                         'edit_posts'             => 'unfiltered_css',
    145                         'edit_others_posts'      => 'unfiltered_css',
    146                         'edit_published_posts'   => 'unfiltered_css',
     143                        'edit_post'              => 'edit_css',
     144                        'edit_posts'             => 'edit_css',
     145                        'edit_others_posts'      => 'edit_css',
     146                        'edit_published_posts'   => 'edit_css',
    147147                        'read_post'              => 'read',
    148148                        'read_private_posts'     => 'read',
    149149                        'publish_posts'          => 'edit_theme_options',