Make WordPress Core


Ignore:
Timestamp:
02/27/2010 07:36:35 AM (15 years ago)
Author:
nacin
Message:

add_editor_style() third pass. better performance and better child theme support. see #11512

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r13444 r13453  
    14661466        return;
    14671467
    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 );
    14971472}
    14981473
     
    15211496 * @return boolean
    15221497 */
    1523 
    15241498function current_theme_supports( $feature ) {
    15251499    global $_wp_theme_features;
Note: See TracChangeset for help on using the changeset viewer.