Call TinyMCE in a WordPress plugin

后端 未结 8 1347
悲哀的现实
悲哀的现实 2020-12-24 05:33

Is there a way to add TinyMCE into my own WordPress plugin?

I have a textarea in my back end script and want to make this area into a TinyMCE WYSIWYG editable field.

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 06:09

    The tiny mce function wp_tiny_mce is now depricated. For Latest wordpress you want to use wp_editor

    $initial_data='What you want to appear in the text box initially';
    $settings = array(
    'quicktags' => array('buttons' => 'em,strong,link',),
    'text_area_name'=>'extra_content',//name you want for the textarea
    'quicktags' => true,
    'tinymce' => true
    );
    $id = 'editor-test';//has to be lower case
    wp_editor($initial_data,$id,$settings);
    

    for more instructions just go through the documentation in wordpress

    http://codex.wordpress.org/Function_Reference/wp_editor

提交回复
热议问题