Make WordPress Core

Changeset 39175


Ignore:
Timestamp:
11/09/2016 01:11:49 AM (8 years ago)
Author:
westonruter
Message:

Customize: Rename unfiltered_css meta capability to edit_css; add revisions support to custom_css post type.

Props lukecavanagh, georgestephanis, westonruter.
See #38672, #35395.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r39016 r39175  
    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.
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r39165 r39175  
    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        ) );
  • trunk/src/wp-includes/customize/class-wp-customize-custom-css-setting.php

    r39151 r39175  
    4747     * @var string
    4848     */
    49     public $capability = 'unfiltered_css';
     49    public $capability = 'edit_css';
    5050
    5151    /**
  • trunk/src/wp-includes/post.php

    r38951 r39175  
    134134        'can_export'       => true,
    135135        '_builtin'         => true, /* internal use only. don't use this when registering your own post type. */
    136         'supports'         => array( 'title' ),
     136        'supports'         => array( 'title', 'revisions' ),
    137137        'capabilities'     => array(
    138138            'delete_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',
  • trunk/tests/phpunit/tests/customize/custom-css-setting.php

    r39151 r39175  
    8080        $this->assertEquals( 'custom_css', $this->setting->type );
    8181        $this->assertEquals( 'twentysixteen', $this->setting->stylesheet );
    82         $this->assertEquals( 'unfiltered_css', $this->setting->capability );
     82        $this->assertEquals( 'edit_css', $this->setting->capability );
    8383
    8484        $exception = null;
Note: See TracChangeset for help on using the changeset viewer.