您可以使用wp_editor
显示wordpress富编辑器。如何显示的较短版本(请查看屏幕截图,我需要它)wp_editor
?
如何显示WP_EDITOR的简短版本?
2 个回复
SO网友:Cedon
您需要将一些参数传递到$settings
的数组wp_editor()
这只告诉它显示strong
,em
,ul
,ol
, 和link
根据您的屏幕截图。
我没有时间对其进行测试,但此代码应该提供您想要的:
$settings = array(
// Any previous settings you are currently using
\'quicktags\' => array( \'buttons\' => \'strong,em,ul,ol,link\' ),
);
wp_editor( \'\', \'my-short-editor\', $settings );
您可以替换\'my-short-editor\'
但请记住,这将是id
渲染时结果编辑器的属性。SO网友:Niket Joshi
以下是编辑器较短版本的代码。
$settings = array(
\'quicktags\' => array(\'buttons\' => \'em,strong,link\',),
\'quicktags\' => true,
\'tinymce\' => true,
\'textarea_rows\' => 20,
\'classes\' => \'yourclass\',
);
或者在调用wp\\U编辑器时:<?php wp_editor( $content, $editor_id, $settings = array(\'editor_class\'=>\'yourclass\') ); ?>
然后只需在css中设置宽度: .yourclass {
width: 400px !important; //add !important if your style is being overriden
}
希望这对你有帮助。更多信息URL 1, URL 2结束