dqxz96998 2011-01-18 04:56
浏览 29

如何在wordpress中加载ckeditor

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

  • 写回答

1条回答 默认 最新

  • donqo88682 2011-01-18 05:21
    关注

    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>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)