Customize: Rename unfiltered_css
meta capability to edit_css
; add revisions
support to custom_css
post type.
Props lukecavanagh, georgestephanis, westonruter. See #38672, #35395. git-svn-id: https://develop.svn.wordpress.org/trunk@39175 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
61fa0a69d6
commit
b20cda2d4b
@ -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 )
|
||||
|
@ -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 );
|
||||
|
@ -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
|
||||
|
@ -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',
|
||||
|
@ -79,7 +79,7 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
|
||||
$this->assertTrue( post_type_exists( 'custom_css' ) );
|
||||
$this->assertEquals( 'custom_css', $this->setting->type );
|
||||
$this->assertEquals( 'twentysixteen', $this->setting->stylesheet );
|
||||
$this->assertEquals( 'unfiltered_css', $this->setting->capability );
|
||||
$this->assertEquals( 'edit_css', $this->setting->capability );
|
||||
|
||||
$exception = null;
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user