Changeset 13441
- Timestamp:
- 02/26/2010 08:12:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/functions.php
r13417 r13441 28 28 29 29 add_custom_background(); 30 31 // This theme styles the visual editor with editor-style.css to match the theme style. 32 add_editor_style(); 30 33 31 34 // This theme needs post thumbnails … … 134 137 } 135 138 endif; 136 137 // Make the Visual Editor styles match the theme's styles138 if ( ! function_exists( 'twentyten_editor_style' ) ) :139 function twentyten_editor_style( $url ) {140 if ( ! empty( $url ) )141 $url .= ',';142 143 // Change the path here if using sub-directory144 $url .= trailingslashit( get_stylesheet_directory_uri() ) . 'editor-style.css';145 146 return $url;147 }148 endif;149 add_filter( 'mce_css', 'twentyten_editor_style' );150 139 151 140 // Remove inline styles on gallery shortcode -
trunk/wp-includes/theme.php
r13417 r13441 1448 1448 1449 1449 /** 1450 * Add callback for a custom TinyMCE editor stylesheet. 1451 * 1452 * The parameter $stylesheet is the name of the stylesheet, relative to 1453 * the theme root. It is optional and defaults to 'editor-style.css'. 1454 * 1455 * @since 3.0.0 1456 * 1457 * @param callback $stylesheet Name of stylesheet relative to theme root. 1458 */ 1459 function add_editor_style( $stylesheet = 'editor-style.css' ) { 1460 if ( isset( $GLOBALS['editor_style'] ) ) 1461 return; 1462 1463 add_theme_support( 'editor-style' ); 1464 1465 if ( ! is_admin() ) 1466 return; 1467 1468 $GLOBALS['editor_style'] = $stylesheet; 1469 add_filter( 'mce_css', '_editor_style_cb' ); 1470 } 1471 1472 /** 1473 * Callback for custom editor stylesheet. 1474 * 1475 * @since 3.0.0 1476 * @see add_editor_style() 1477 * @access protected 1478 */ 1479 function _editor_style_cb( $url ) { 1480 global $editor_style; 1481 if ( ! empty( $url ) ) 1482 $url .= ','; 1483 return $url . get_stylesheet_directory_uri() . "/$editor_style"; 1484 } 1485 1486 /** 1450 1487 * Allows a theme to register its support of a certain feature 1451 1488 *
Note: See TracChangeset
for help on using the changeset viewer.