add_editor_style [ WordPress Function ]
| Parameters: |
|
| Defined at: |
|
Add callback for custom TinyMCE editor stylesheets.
The parameter $stylesheet is the name of the stylesheet, relative to the theme root. It also accepts an array of stylesheets. It is optional and defaults to 'editor-style.css'.
This function automatically adds another stylesheet with -rtl prefix, e.g. editor-style-rtl.css. If that file doesn't exist, it is removed before adding the stylesheet(s) to TinyMCE. If an array of stylesheets is passed to add_editor_style(), RTL is only added for the first stylesheet.
Since version 3.4 the TinyMCE body has .rtl CSS class. It is a better option to use that class and add any RTL styles to the main stylesheet.
Source
<?php
function add_editor_style( $stylesheet = 'editor-style.css' ) {
add_theme_support( 'editor-style' );
if ( ! is_admin() )
return;
global $editor_styles;
$editor_styles = (array) $editor_styles;
$stylesheet = (array) $stylesheet;
if ( is_rtl() ) {
$rtl_stylesheet = str_replace('.css', '-rtl.css', $stylesheet[0]);
$stylesheet[] = $rtl_stylesheet;
}
$editor_styles = array_merge( $editor_styles, $stylesheet );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/add editor style « WordPress Codex
Description. Add callback for custom TinyMCE editor stylesheets. This function is ONLY for in-theme stylesheets, see mce_css for plugin usage. The parameter ...
codex.wordpress.org - WordPress › Support » How to use new add_editor_style() function
add_editor_style();. Then I created an editor-style.css file in my child theme's folder and added this: html .mceContentBody { max-width:591px; }. When I go to the ...
wordpress.org - wysiwyg - How do I use new add_editor_style() function in ...
I found this article: ... add_theme_support('editor_style');. before add_editor_style( 'tinymce-styles.css');. assuming that your custom css is in your ...
stackoverflow.com - add_editor_style not working? | Ben Word
Mar 18, 2011 ... add_editor_style tells WordPress to let you use editor-style.css in your theme directory to control the styling of TinyMCE's editor. You can run ...
benword.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- cmegown on "editor-style.css not working"
- cmegown on "editor-style.css not working"
- Tammy Hart on "add_editor_style function not working (WP 3.3)"
- dkotter on "add_editor_style function not working (WP 3.3)"
- pulk99 on "add_editor_style function not working (WP 3.3)"
- Frank Bültge on "add_editor_style for plugin"
- Mark / t31os on "add_editor_style for plugin"
- dwieeb on "add_editor_style for plugin"