I would like to get html class names same way get_body_class()
works but on the admin side. I would like to change body class names of TinyMCEs iFrame element to allow specified editor-styles.css
styles work only when editing page with .page
and .home
classes.
Styles:
body.page.home table td:nth-child(2) {
padding-left:30px;
}
This is not working:
add_filter('tiny_mce_before_init', function($init_array) {
//var_dump(get_option( 'page_on_front'));
//var_dump(get_option('show_on_front'));
if (is_front_page()) {
$init_array['body_class'][] = 'home';
}
if (is_page()) {
$init_array['body_class'][] = 'page';
}
if (isset($init_array['body_class']) && is_array($init_array['body_class'])) {
$init_array['body_class'] = implode(' ', $init_array['body_class']);
}
}
In other words:
How to specify custom editor-styles for TinyMCE for just one exact page (in my case it is home page).