From 487af08ce70068e5039a22382ae83460e8306635 Mon Sep 17 00:00:00 2001
From: denis <denis@deniska>
Date: May 5, 2017 10:30:47 PM
Replaced Additional CSS default value to placeholder
diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php
index 5fb2d76..cea83f1 100644
a
|
b
|
|
4149 | 4149 | ) ); |
4150 | 4150 | |
4151 | 4151 | $custom_css_setting = new WP_Customize_Custom_CSS_Setting( $this, sprintf( 'custom_css[%s]', get_stylesheet() ), array( |
4152 | | 'capability' => 'edit_css', |
4153 | | 'default' => sprintf( "/*\n%s\n*/", __( "You can add your own CSS here.\n\nClick the help icon above to learn more." ) ), |
| 4152 | 'capability' => 'edit_css' |
4154 | 4153 | ) ); |
4155 | 4154 | $this->add_setting( $custom_css_setting ); |
4156 | 4155 | |
… |
… |
|
4160 | 4159 | 'settings' => array( 'default' => $custom_css_setting->id ), |
4161 | 4160 | 'input_attrs' => array( |
4162 | 4161 | 'class' => 'code', // Ensures contents displayed as LTR instead of RTL. |
| 4162 | 'placeholder' => __( 'You can add your own CSS here.\n\nClick the help icon above to learn more.' ), |
4163 | 4163 | ), |
4164 | 4164 | ) ); |
4165 | 4165 | } |
diff --git a/src/wp-includes/customize/class-wp-customize-custom-css-setting.php b/src/wp-includes/customize/class-wp-customize-custom-css-setting.php
index d694395..362183c 100644
a
|
b
|
|
140 | 140 | if ( $post ) { |
141 | 141 | $value = $post->post_content; |
142 | 142 | } |
143 | | if ( empty( $value ) ) { |
144 | | $value = $this->default; |
145 | | } |
146 | 143 | |
147 | 144 | /** This filter is documented in wp-includes/class-wp-customize-setting.php */ |
148 | 145 | $value = apply_filters( "customize_value_{$id_base}", $value, $this ); |
diff --git a/tests/phpunit/tests/customize/custom-css-setting.php b/tests/phpunit/tests/customize/custom-css-setting.php
index 3dea39e..b9d6ac0 100644
a
|
b
|
|
109 | 109 | * @covers WP_Customize_Custom_CSS_Setting::update() |
110 | 110 | */ |
111 | 111 | function test_crud() { |
112 | | |
113 | | $this->setting->default = '/* Hello World */'; |
114 | | $this->assertEquals( $this->setting->default, $this->setting->value() ); |
115 | | |
116 | 112 | $this->assertNull( wp_get_custom_css_post() ); |
117 | 113 | $this->assertNull( wp_get_custom_css_post( $this->setting->stylesheet ) ); |
118 | 114 | $this->assertNull( wp_get_custom_css_post( 'twentyten' ) ); |