INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Dynamically generated Wordpress Wysiwyg Editor ( wp_editor ) not displaying properly

Dynamically generated Wordpress Wysiwyg Editor ( wp_editor ) not displaying properly

Dynamically generated Wordpress Wysiwyg Editor ( wp_editor ) not displaying properly

(OP)

I have 2 html wysiwyg editors on a wordpress admin page. Both use WP_EDITOR() function. The first one is hard coded into the page:

CODE --> html

<form name="form1" id="form1" method="post" action="" style="display:block;">
  <p>
    <!-- editor here -->
    <?php
       wp_editor( 'CONTENT WILL APPEAR HERE!', 'addsometxt', array('textarea_name'=>'create_txt','textarea_rows'=>10,'wpautop'=>false));
    ?>
  </p>
  <p>
   <input name="save" type="submit" class="button-primary" id="save" style="margin:5px;" value="Save Input" /></p>
</form> 

The second one is generated dynamically with a PHP function using an AJAX call (wp_ajax_ and $.post). I've test the ajax call and know it works; so, for brevity, here's the php function:

CODE --> php

<?php
function display_editor2() {
// grab data from database (data_from_db) and display in editor
  wp_editor( $row->data_from_db, 'editsometxt', array('textarea_name'=>'edit_txt','textarea_rows'=>10,'wpautop'=>false));

} 
?> 

The problem is that even though the 2nd editor is displaying; it's missing all the tool bar buttons. See image below for illustration. Anyone know who to fix this?

Any and all help, insights and constructive comments are welcome. Thanks!

RE: Dynamically generated Wordpress Wysiwyg Editor ( wp_editor ) not displaying properly

try adding this at the top of your wp-config.php file

CODE

define( 'CONCATENATE_SCRIPTS', false ); 

it should be the first entry after

CODE

<?php 

Darryn Cooke
www.darryncooke.com | Marketing and Creative Services

RE: Dynamically generated Wordpress Wysiwyg Editor ( wp_editor ) not displaying properly

(OP)
Hi Darryn,

Thanks. What does that do? What is CONCATENATE_SCRIPTS for?

Also, is there another workaround? This is for a plugin; and I don't imagine many users will feel comfortable changing their wp-config settings.

Thanks again,
- Tyhand

RE: Dynamically generated Wordpress Wysiwyg Editor ( wp_editor ) not displaying properly

this is for javascript concatenation https://en.wikipedia.org/wiki/Concatenation -

you could check to see if ALL the necessary files for the tiny-mce plugin are in their respective folders.

either way try the concatenate method first to see if it at least works or not. If it doesn't work then there could be a conflict between plugins and you would have to start debugging by disabling all and enabling one at a time to find the conflict.

Darryn Cooke
www.darryncooke.com | Marketing and Creative Services

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close