Changeset 13441 for trunk/wp-includes/theme.php
- Timestamp:
- 02/26/2010 08:12:06 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
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.