【发布时间】:2011-01-18 04:56:38
【问题描述】:
我有一个 wordpress 网站,我在管理区域仪表板中创建了一个包含文本区域的框,现在我希望我的 textarea 实现 ckeditor,有人知道该怎么做吗?
这是我在主题functions.php中的代码sn-p
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
}
如果你在上面看到,我的代码 sn-p 上面有一个文本区域,我想将该文本区域更改为 ckeditor UI。
提前致谢 和
【问题讨论】:
标签: php javascript wordpress ckeditor