也许你应该使用wp_editor 相反这样您就可以更好地控制编辑器。例如,在自定义帖子类型中有一个名为“myfield”的元框。如果需要一个简单的编辑器,可以执行以下操作:
echo \'<form action="" method="post" target="_blank">\';
wp_editor(\'<p>Some content</p>\', \'myfield\' );
echo \'<input type="submit" value="Submit" /></form>\';
如果需要更多控制,可以在数组中启用如下内容:
$settings = array(
\'wpautop\' => true,
\'media_buttons\' => false,
\'tinymce\' => array(
\'theme_advanced_buttons1\' => \'bold,italic,underline,blockquote,|,undo,redo,|,fullscreen\',
\'theme_advanced_buttons2\' => \'\',
\'theme_advanced_buttons3\' => \'\',
\'theme_advanced_buttons4\' => \'\'
),
\'quicktags\' => array(
\'buttons\' => \'b,i,ul,ol,li,link,close\'
)
);
echo \'<form action="" method="post" target="_blank">\';
wp_editor(\'<p>Some more content</p>\', \'myfield\', $settings );
echo \'<input type="submit" value="Submit" /></form>\';