Changeset 13453
- Timestamp:
- 02/27/2010 07:36:35 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r13242 r13453 1306 1306 */ 1307 1307 function wp_tiny_mce( $teeny = false, $settings = false ) { 1308 global $concatenate_scripts, $compress_scripts, $tinymce_version ;1308 global $concatenate_scripts, $compress_scripts, $tinymce_version, $editor_styles; 1309 1309 1310 1310 if ( ! user_can_richedit() ) … … 1468 1468 ); 1469 1469 1470 $mce_css = trim(apply_filters('mce_css', ''), ' ,'); 1470 if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) { 1471 $mce_css = array(); 1472 $style_uri = get_stylesheet_directory_uri(); 1473 if ( TEMPLATEPATH == STYLESHEETPATH ) { 1474 foreach ( $editor_styles as $file ) 1475 $mce_css[] = "$style_uri/$file"; 1476 } else { 1477 $style_dir = get_stylesheet_directory(); 1478 $template_uri = get_template_directory_uri(); 1479 $template_dir = get_template_directory(); 1480 foreach ( $editor_styles as $file ) { 1481 if ( file_exists( "$style_dir/$file" ) ) 1482 $mce_css[] = "$style_uri/$file"; 1483 if ( file_exists( "$template_dir/$file" ) ) 1484 $mce_css[] = "$template_uri/$file"; 1485 } 1486 } 1487 $mce_css = implode( ',', $mce_css ); 1488 } else { 1489 $mce_css = ''; 1490 } 1491 1492 $mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' ); 1471 1493 1472 1494 if ( ! empty($mce_css) ) -
trunk/wp-includes/theme.php
r13444 r13453 1466 1466 return; 1467 1467 1468 global $editor_style; 1469 $editor_style = (array) $editor_style; 1470 $stylesheet = (array) $stylesheet; 1471 foreach ( $stylesheet as $file ) { 1472 if ( file_exists( get_stylesheet_directory() . "/$file" ) 1473 && ( $uri = get_stylesheet_directory_uri() . "/$file" ) 1474 && ! in_array( $uri, $editor_style ) ) 1475 $editor_style[] = $uri; 1476 elseif ( TEMPLATEPATH !== STYLESHEETPATH 1477 && file_exists( get_template_directory() . "/$file" ) 1478 && ( $uri = get_template_directory_uri() . "/$file" ) 1479 && ! in_array( $uri, $editor_style ) ) 1480 $editor_style[] = $uri; 1481 } 1482 add_filter( 'mce_css', '_editor_style_cb' ); 1483 } 1484 1485 /** 1486 * Callback for custom editor stylesheet support. 1487 * 1488 * @since 3.0.0 1489 * @see add_editor_style() 1490 * @access protected 1491 */ 1492 function _editor_style_cb( $url ) { 1493 global $editor_style; 1494 if ( ! empty( $url ) ) 1495 $url .= ','; 1496 return $url . implode( ',', $editor_style ); 1468 global $editor_styles; 1469 $editor_styles = (array) $editor_styles; 1470 $stylesheet = (array) $stylesheet; 1471 $editor_styles = array_merge( $editor_styles, $stylesheet ); 1497 1472 } 1498 1473 … … 1521 1496 * @return boolean 1522 1497 */ 1523 1524 1498 function current_theme_supports( $feature ) { 1525 1499 global $_wp_theme_features;
Note: See TracChangeset
for help on using the changeset viewer.