实际上,您可以包含编辑器样式。css(或任何其他样式表),只需将“content\\u css”值传递给指向css文件的tinymce即可:
wp_editor(
$content,
\'editablecontent\',
array(
\'tinymce\' => array(
\'content_css\' => get_stylesheet_directory_uri() . \'/editor-styles.css\'
)
);
因此,海报的原始代码如下所示:
add_filter( \'comment_form_defaults\', \'custom_comment_form_defaults\' );
function custom_comment_form_defaults( $args ) {
if ( is_user_logged_in() ) {
$mce_plugins = \'inlinepopups, wordpress, wplink, wpdialogs\';
} else {
$mce_plugins = \'fullscreen, wordpress\';
}
add_filter( \'wp_default_editor\', create_function(\'\', \'return "tinymce";\') );
ob_start();
wp_editor( \'\', \'comment\', array(
\'media_buttons\' => false,
\'teeny\' => true,
\'textarea_rows\' => \'7\',
\'tinymce\' => array(
\'plugins\' => $mce_plugins,
\'content_css\' => get_stylesheet_directory_uri() . \'/editor-styles.css\'
)
) );
$args[\'comment_field\'] = ob_get_clean();
return $args;
}