以下是我的解决方案:
add_filter(\'the_editor_content\', "firmasite_tinymce_style");
function firmasite_tinymce_style($content) {
add_editor_style(\'assets/css/custom.css\');
// This is for front-end tinymce customization
if ( ! is_admin() ) {
global $editor_styles;
$editor_styles = (array) $editor_styles;
$stylesheet = (array) $stylesheet;
$stylesheet[] = \'assets/css/custom.css\';
$editor_styles = array_merge( $editor_styles, $stylesheet );
}
return $content;
}
现场示例:
http://unsalkorkmaz.com/firmasite-social-buddypress-bbpress-theme-based-on-bootstrap/检查注释wp\\U编辑器。。其加载引导程序。css和google字体等。。
此代码是额外的:
// Removing wordpress version from script and styles
add_action("wp_head", "firmasite_remove_version_from_assets",1);
function firmasite_remove_version_from_assets(){
function remove_cssjs_ver( $src ) {
if( strpos( $src, \'?ver=\' ) )
$src = remove_query_arg( \'ver\', $src );
return $src;
}
add_filter( \'style_loader_src\', \'remove_cssjs_ver\', 999 );
add_filter( \'script_loader_src\', \'remove_cssjs_ver\', 999 );
}
它将从样式和脚本中删除版本。所以浏览器不会将同一样式加载两次。