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
you can use the Plugin CKEditor For WordPress.
I know wordpress only a little, but you can go with the ckeditor help, too:
<textarea id="editor1" name="editor1"><p>Initial value.</p></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'editor1' );
</script>
精彩评论