是否有任何方法在此选项中设置WYSIWYG框的复选框,以便管理员能够隐藏它,以防页面中不需要内容
发布于 2012-08-14 19:11:59
内容框位于一个ID为<div>的#postdivrich中,因此您可以使用CSS隐藏它。
可能最简单的方法就是向现有的页面添加一个设置选项,这样您就可以关闭或打开它。下面的员额详细说明了这一点:
http://wpengineer.com/2139/adding-settings-to-an-existing-page-using-the-settings-api/
设置就绪后,您需要检查它并将CSS输出到正确的位置。将其添加到functions.php中:
if (get_option('paradise_hide_editor') == 'yes') {
function paradise_hide_editor() {
echo '
<style type="text/css">
#postdivrich {display: none}
</style>';
}
add_action('admin_head', 'paradise_hide_editor');
}https://wordpress.stackexchange.com/questions/61851
复制相似问题