Forums

TinyMCE for custom plugin not working since 3.1 (3 posts)

  1. Ryann
    Member
    Posted 1 year ago #

    Hello,

    I have been writing a custom plugin (for my own use only) to collect some specific info. I upgraded wordpress to 3.1 last week, but just realized today that the TinyMCE editors were no longer appearing in the specified text areas of the plugin administration pages. I assume it was something to do with the 3.1 upgrade, but I was making edits to this script last week so it could be anything really.

    To explain the code, first I add a reference to the TinyMCE library in the wp-includes folder, then make my initializing call, further down the script we have my text area as a part of an Add form.

    <?php
    //Add New newnow Form
    function newnow_newform() {
    ?>
    
    <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce.js"></script>
    
    <script type="text/javascript">
    <!--
    tinyMCE.init({
    theme : "advanced",
    mode : "exact",
    elements : "description",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,code",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "bottom",
    theme_advanced_toolbar_align : "left",
    width : "400",
    height : "200"
    });
    -->
    </script>
    
    <div class="wrap">
    	<div id="newnow-form">
    	<fieldset>
            <legend>Add New & Now</legend>
    	<form name="addnew" method="post" enctype="multipart/form-data" action="admin.php?page=manage_newnow">
    	<label for="newnowdate" >Date:</label><input name="newnowdate" type="text" size="15" value="<?php echo date("Y-m-d");?>"><br/>
    	<label for="description" >Description:</label>  <textarea name="description" id="description" cols="40" rows="3"></textarea>
    	<input type="submit" name="newnow_addnew" style="margin-left:10.75em;" value="<?php _e('Add New & Now', 'newnow_addnew' ) ?>" /><br/>
    	</form>
            </fieldset>
    	</div>
    </div>
    
    <?php
    }
    ?>

    When I view the source (in firefox) and click on the link created for the JS file I see the file so I know the path is right.

    It just seems that the initialization isn't occurring somehow.

    If you can see the trouble or have tips on how to troubleshoot it would be very much appreciated!

    Thanks in advance!

  2. pbpatil519
    Member
    Posted 1 year ago #

    I am also facing the same problem please let me know if you find the solution

  3. fjpalawan
    Member
    Posted 1 year ago #

    Hi im using this code to call tinymce

    wp_tiny_mce( true ,
    array(
    "editor_selector" => "textarea",
    "height" => 300,
    "width" => 300
    //add other filters here
    )
    );

    it calls the editor but im having problem with the anchor tag prior to wp 3.1

    you can give it a try to see if it works for you.

    have a nice day

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags