• Resolved landykos

    (@landykos)


    Hello I am using the following plugin (https://codex.www.ads-software.com/Adding_Administration_Menus) to create my own custom admin pages. The plugin works great and so do the admin pages.

    The problem is that when I try to add textareas to my pages I can not get the tinymce editor to work correctly. I have included the same code that is used in the post-new.php pages.

    Ex:
    This code at the top of the pages:

    <?php
    wp_enqueue_script(‘autosave’);
    wp_enqueue_script(‘post’);
    if ( user_can_richedit() )
    wp_enqueue_script(‘editor’);
    wp_enqueue_script(‘thickbox’);
    wp_enqueue_script(‘media-upload’);
    ?>


    This code in the Divs:

    <div id=”poststuff”>
    <div id=”post-body”>
    <div id=”postdivrich” class=”postarea”>
    <h3><?php _e(‘Content’) ?></h3>
    <?php the_editor($Spot->Content); ?>
    <?php wp_nonce_field( ‘autosave’, ‘autosavenonce’, false ); ?>
    <?php wp_nonce_field( ‘closedpostboxes’, ‘closedpostboxesnonce’, false ); ?>
    <?php wp_nonce_field( ‘getpermalink’, ‘getpermalinknonce’, false ); ?>
    <?php wp_nonce_field( ‘samplepermalink’, ‘samplepermalinknonce’, false ); ?>

    </div>
    </div>
    </div>

    Any help would be great.
    Thanks in advance.

    LK

Viewing 1 replies (of 1 total)
  • Thread Starter landykos

    (@landykos)

    Figured it out.
    You have to add

    <?php
    wp_enqueue_script(‘autosave’);
    wp_enqueue_script(‘post’);
    if ( user_can_richedit() )
    wp_enqueue_script(‘editor’);
    wp_enqueue_script(‘thickbox’);
    wp_enqueue_script(‘media-upload’);
    ?>

    in the admin.php file so that the javascript is printed before the admin-header file is called.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘How to add a extra Tinymce Editor to custom Admin pages’ is closed to new replies.