Don't pass non-existing rtl stylesheet to TinyMCE, update phpdoc for add_editor_style(), see #19437
git-svn-id: https://develop.svn.wordpress.org/trunk@20059 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
98c3fef8f7
commit
5d4a0adebd
@ -328,24 +328,25 @@ final class _WP_Editors {
|
||||
$mce_css = array();
|
||||
$editor_styles = array_unique($editor_styles);
|
||||
$style_uri = get_stylesheet_directory_uri();
|
||||
if ( ! is_child_theme() ) {
|
||||
foreach ( $editor_styles as $file )
|
||||
$style_dir = get_stylesheet_directory();
|
||||
|
||||
foreach ( $editor_styles as $key => $file ) {
|
||||
if ( $file && file_exists( "$style_dir/$file" ) ) {
|
||||
$mce_css[] = "$style_uri/$file";
|
||||
} else {
|
||||
$style_dir = get_stylesheet_directory();
|
||||
$editor_styles[$key] = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_child_theme() ) {
|
||||
$template_uri = get_template_directory_uri();
|
||||
$template_dir = get_template_directory();
|
||||
|
||||
foreach ( $editor_styles as $file ) {
|
||||
if ( file_exists( "$template_dir/$file" ) )
|
||||
if ( $file && file_exists( "$template_dir/$file" ) )
|
||||
$mce_css[] = "$template_uri/$file";
|
||||
}
|
||||
|
||||
foreach ( $editor_styles as $file ) {
|
||||
if ( file_exists( "$style_dir/$file" ) )
|
||||
$mce_css[] = "$style_uri/$file";
|
||||
}
|
||||
}
|
||||
|
||||
$mce_css = implode( ',', $mce_css );
|
||||
} else {
|
||||
$mce_css = '';
|
||||
|
@ -1334,10 +1334,14 @@ body.custom-background { <?php echo trim( $style ); ?> }
|
||||
* the theme root. It also accepts an array of stylesheets.
|
||||
* It is optional and defaults to 'editor-style.css'.
|
||||
*
|
||||
* Supports RTL stylesheets automatically by searching for the -rtl prefix, e.g.
|
||||
* editor-style-rtl.css. If an array of stylesheets is passed to add_editor_style(),
|
||||
* 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.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param mixed $stylesheet Optional. Stylesheet name or array thereof, relative to theme root.
|
||||
|
Loading…
Reference in New Issue
Block a user