Changeset 39151
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r39149 r39151 3600 3600 $custom_css_setting = new WP_Customize_Custom_CSS_Setting( $this, sprintf( 'custom_css[%s]', get_stylesheet() ), array( 3601 3601 'capability' => 'unfiltered_css', 3602 'default' => sprintf( "/*\n%s\n*/", __( "You can add your own CSS here.\n\nClick the help icon above to learn more." ) ), 3602 3603 ) ); 3603 3604 $this->add_setting( $custom_css_setting ); … … 3607 3608 'section' => 'custom_css', 3608 3609 'settings' => array( 'default' => $custom_css_setting->id ), 3609 'input_attrs' => array(3610 'placeholder' => __( "/*\nYou can add your own CSS here.\n\nClick the help icon above to learn more.\n*/" ),3611 )3612 3610 ) ); 3613 3611 } -
trunk/src/wp-includes/customize/class-wp-customize-custom-css-setting.php
r39009 r39151 129 129 */ 130 130 public function value() { 131 return wp_get_custom_css( $this->stylesheet ); 131 $value = wp_get_custom_css( $this->stylesheet ); 132 if ( empty( $value ) ) { 133 $value = $this->default; 134 } 135 return $value; 132 136 } 133 137 -
trunk/tests/phpunit/tests/customize/custom-css-setting.php
r39020 r39151 102 102 103 103 /** 104 * Test WP_Customize_Custom_CSS_Setting::update().104 * Test crud methods on WP_Customize_Custom_CSS_Setting. 105 105 * 106 106 * @covers wp_get_custom_css() … … 110 110 */ 111 111 function test_crud() { 112 113 $this->setting->default = '/* Hello World */'; 114 $this->assertEquals( $this->setting->default, $this->setting->value() ); 115 112 116 $original_css = 'body { color: black; }'; 113 117 $this->factory()->post->create( array(
Note: See TracChangeset
for help on using the changeset viewer.