Ticket #35395: customize-css.diff
File customize-css.diff, 5.3 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/customize-controls.css
533 533 margin-bottom: 5px; 534 534 } 535 535 536 .customize-control-description a.external-link:after { 537 font: 16px/11px dashicons; 538 content: "\f310"; 539 top: 3px; 540 position: relative; 541 } 542 536 543 .customize-control-color .color-picker, 537 544 .customize-control-upload div { 538 545 line-height: 28px; -
src/wp-includes/class-wp-customize-control.php
423 423 * 424 424 * Allows the content to be overriden without having to rewrite the wrapper in $this->render(). 425 425 * 426 * Supports basic input types ` text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`.426 * Supports basic input types `none`, `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`. 427 427 * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly. 428 428 * 429 429 * Control content can alternately be rendered in JS. See {@see WP_Customize_Control::print_template()}. … … 432 432 */ 433 433 protected function render_content() { 434 434 switch( $this->type ) { 435 case 'none': 436 if ( ! empty( $this->label ) ) : ?> 437 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 438 <?php endif; 439 if ( ! empty( $this->description ) ) : ?> 440 <span class="description customize-control-description"><?php echo $this->description; ?></span> 441 <?php endif; 442 break; 435 443 case 'checkbox': 436 444 ?> 437 445 <label> -
src/wp-includes/class-wp-customize-manager.php
2075 2075 'type' => 'dropdown-pages', 2076 2076 ) ); 2077 2077 } 2078 2079 /* Custom CSS */ 2080 2081 $this->add_section( 'custom_css', array( 2082 'title' => __( 'Custom CSS' ), 2083 'priority' => 140, 2084 ) ); 2085 2086 $this->add_setting( 'wp_custom_css' , array( 2087 'type' => 'theme_mod', 2088 'transport' => 'postMessage', 2089 ) ); 2090 2091 $this->add_control( 'wp_custom_css', array( 2092 'label' => __( 'Custom CSS' ), 2093 'description' => __( 'CSS allows you to customize the appearance and layout of your site with code. Each theme has its own set of CSS styles, which this option overrides on a per-theme basis. <a href="https://codex.wordpress.org/Know_Your_Sources#CSS" class="external-link">Learn more about CSS <span class="screen-reader-text">(link opens in a new window)</span></a>.' ), 2094 'type' => 'textarea', 2095 'section' => 'custom_css', 2096 ) ); 2097 2098 if ( ! is_multisite() ) { 2099 $this->add_setting( 'wp_custom_css_more', array() ); 2100 $this->add_control( 'wp_custom_css_more', array( 2101 'type' => 'none', 2102 'description' => __( 'Enjoy writing custom CSS? <a href="https://developer.wordpress.org/themes/advanced-topics/child-themes/" class="external-link">Take your customizations to the next level with a child theme <span class="screen-reader-text">(link opens in a new window)</span></a>.' ), 2103 'section' => 'custom_css', 2104 ) ); 2105 } 2078 2106 } 2079 2107 2080 2108 /** -
src/wp-includes/default-filters.php
236 236 add_action( 'wp_head', 'wp_generator' ); 237 237 add_action( 'wp_head', 'rel_canonical' ); 238 238 add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); 239 add_action( 'wp_head', 'wp_custom_css_cb', 11 ); 239 240 add_action( 'wp_head', 'wp_site_icon', 99 ); 240 241 add_action( 'wp_footer', 'wp_print_footer_scripts', 20 ); 241 242 add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); -
src/wp-includes/js/customize-preview.js
169 169 }); 170 170 }); 171 171 172 api( 'wp_custom_css', function( value ) { 173 value.bind( function( to ) { 174 $( '#wp-custom-css' ).html( to ); 175 } ); 176 } ); 177 172 178 api.trigger( 'preview-ready' ); 173 179 }); 174 180 -
src/wp-includes/theme.php
1396 1396 <?php 1397 1397 } 1398 1398 1399 1399 1400 /** 1401 * Render custom CSS. 1402 * 1403 * @since 4.5 1404 */ 1405 function wp_custom_css_cb() { 1406 $styles = get_theme_mod( 'wp_custom_css' ); 1407 if ( $styles ) : 1408 ?> 1409 <style type="text/css" id="wp-custom-css"> 1410 <?php echo $styles; ?> 1411 </style> 1412 <?php 1413 endif; 1414 } 1415 1416 /** 1400 1417 * Add callback for custom TinyMCE editor stylesheets. 1401 1418 * 1402 1419 * The parameter $stylesheet is the name of the stylesheet, relative to