From 08712b4baa6769eaa0823a0eee337ce6e1e0dcd6 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 9 Nov 2016 01:12:30 +0000 Subject: [PATCH] Customize: Rename `unfiltered_css` meta capability to `edit_css`; add `revisions` support to `custom_css` post type. Props lukecavanagh, georgestephanis, westonruter. See #38672, #35395. Built from https://develop.svn.wordpress.org/trunk@39175 git-svn-id: http://core.svn.wordpress.org/trunk@39115 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/capabilities.php | 2 +- wp-includes/class-wp-customize-manager.php | 2 +- .../class-wp-customize-custom-css-setting.php | 2 +- wp-includes/post.php | 10 +++++----- wp-includes/version.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index fe87bc8d70..35b0b5f762 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -320,7 +320,7 @@ function map_meta_cap( $cap, $user_id ) { else $caps[] = 'do_not_allow'; break; - case 'unfiltered_css' : + case 'edit_css' : case 'unfiltered_html' : // Disallow unfiltered_html for all users, even admins and super admins. if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 13856ceb0c..96acb450ec 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -3598,7 +3598,7 @@ final class WP_Customize_Manager { ) ); $custom_css_setting = new WP_Customize_Custom_CSS_Setting( $this, sprintf( 'custom_css[%s]', get_stylesheet() ), array( - 'capability' => 'unfiltered_css', + 'capability' => 'edit_css', 'default' => sprintf( "/*\n%s\n*/", __( "You can add your own CSS here.\n\nClick the help icon above to learn more." ) ), ) ); $this->add_setting( $custom_css_setting ); diff --git a/wp-includes/customize/class-wp-customize-custom-css-setting.php b/wp-includes/customize/class-wp-customize-custom-css-setting.php index 17e01fc6a5..034e081484 100644 --- a/wp-includes/customize/class-wp-customize-custom-css-setting.php +++ b/wp-includes/customize/class-wp-customize-custom-css-setting.php @@ -46,7 +46,7 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting { * * @var string */ - public $capability = 'unfiltered_css'; + public $capability = 'edit_css'; /** * Stylesheet diff --git a/wp-includes/post.php b/wp-includes/post.php index 89ddaaa711..e1276cdcb7 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -133,17 +133,17 @@ function create_initial_post_types() { 'delete_with_user' => false, 'can_export' => true, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ - 'supports' => array( 'title' ), + 'supports' => array( 'title', 'revisions' ), 'capabilities' => array( 'delete_posts' => 'edit_theme_options', 'delete_post' => 'edit_theme_options', 'delete_published_posts' => 'edit_theme_options', 'delete_private_posts' => 'edit_theme_options', 'delete_others_posts' => 'edit_theme_options', - 'edit_post' => 'unfiltered_css', - 'edit_posts' => 'unfiltered_css', - 'edit_others_posts' => 'unfiltered_css', - 'edit_published_posts' => 'unfiltered_css', + 'edit_post' => 'edit_css', + 'edit_posts' => 'edit_css', + 'edit_others_posts' => 'edit_css', + 'edit_published_posts' => 'edit_css', 'read_post' => 'read', 'read_private_posts' => 'read', 'publish_posts' => 'edit_theme_options', diff --git a/wp-includes/version.php b/wp-includes/version.php index e2d1330532..b3e520693b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta2-39174'; +$wp_version = '4.7-beta2-39175'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.