如何在wordpress中加载ckeditor
我有一个 WordPress 网站,我在管理区域仪表板创建了一个包含文本区域的框,现在我想要我的文本区域实现 ckeditor,有人知道怎么做吗?
这是我在主题functions.php中的代码片段
function tresquint_news_dashboard_widget(){
if ( $_POST['tresquint_submit_news'] ){
$options = $_POST['tresquint_news'];
$options['time'] = time();
update_option('tresquint_news', $options );
echo '<div class="updated fade"><p>Updated news.</p></div>';
}
$options = get_option("tresquint_news");
?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<p><?php _e("Enter a short news"); ?></p>
<p><label for="tresquint_news_text"><?php _e('News'); ?></label><textarea id="tresquint_news_text" style="width: 100%; margin-top: 5px;" name="tresquint_news[text]"><?php echo $options['text']; ?></textarea></p>
<p class="submit"><input style="float: right;" type="submit" name="tresquint_submit_news" value="<?php _e('Publish'); ?>" /><div class='clear'></div></p></form><?php
}
,如果你看到,我的代码片段上面有一个文本区域,我想将该文本区域更改为ckeditor UI。
提前致谢 和
I have a wordpress site, and i create a box at admin area dashboard which contain a text area, and now i want my textarea implement ckeditor, does anyone knows how to do it?
here's my code snippet at themes functions.php
function tresquint_news_dashboard_widget(){
if ( $_POST['tresquint_submit_news'] ){
$options = $_POST['tresquint_news'];
$options['time'] = time();
update_option('tresquint_news', $options );
echo '<div class="updated fade"><p>Updated news.</p></div>';
}
$options = get_option("tresquint_news");
?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<p><?php _e("Enter a short news"); ?></p>
<p><label for="tresquint_news_text"><?php _e('News'); ?></label><textarea id="tresquint_news_text" style="width: 100%; margin-top: 5px;" name="tresquint_news[text]"><?php echo $options['text']; ?></textarea></p>
<p class="submit"><input style="float: right;" type="submit" name="tresquint_submit_news" value="<?php _e('Publish'); ?>" /><div class='clear'></div></p></form><?php
}
if you see on ,my code snippet above there's a text area, and i want to change that text area into ckeditor UI.
Thanks in advance
AnD
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用WordPress CKEditor 插件。
我只了解一点 WordPress,但您也可以使用 ckeditor 帮助 :
you can use the Plugin CKEditor For WordPress.
I know wordpress only a little, but you can go with the ckeditor help, too: