Merge pull request #2073 from IanDelMar/classic-editor-body-margin

Fix TinyMCE body margin
This commit is contained in:
Brian Coords 2023-10-09 15:50:19 -07:00 committed by GitHub
commit 1747a156e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -82,6 +82,18 @@ if ( ! function_exists( 'understrap_tiny_mce_before_init' ) ) {
}
$settings['style_formats'] = wp_json_encode( $style_formats );
/*
* Fix TinyMCE editor body margin that is set to 0 by Bootstrap's
* _reboot.scss (v4 & v5). `margin: 9px 10px` is the value used by WP's
* TinyMCE skin (/wp-includes/js/tinymce/skins/wordpress/wp-content.css).
*/
if ( isset( $settings['content_style'] ) ) {
$settings['content_style'] .= ' body#tinymce { margin: 9px 10px; }';
} else {
$settings['content_style'] = 'body#tinymce { margin: 9px 10px; }';
}
return $settings;
}
}