Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

WordPress wp_editor() and WPAlchemy. WordPress

I'm using WPAlchemy and I'm using the new wp_editor for the editor. That works perfectly fine.

My issue is when I use WPAlchemy's "docopy" function for a repeatable group.

The editor is copied but is not functional at first. It is copied and displayed, but the area is not clickable and you can't do anything with it.

BUT... if I save the page the new "copied" editor is there and it works perfectly.

Any ideas on this?

Please help.

Answers (3)

2012-01-31

Ivaylo Draganov answers:

<blockquote>Once instantiated, the WYSIWYG editor cannot be moved around in the DOM. What this means in practical terms, is that you cannot put it in meta-boxes that can be dragged and placed elsewhere on the page. </blockquote>

This is a quote from the [[LINK href="http://codex.wordpress.org/Function_Reference/wp_editor"]]function reference for wp_editor()[[/LINK]]. That's what happens when WPAlchemy copies the field - it essentially moves the instance of the editor. I think that's the problem here.

2012-02-01

Oleg Butuzov answers:

Its posible to change WPAlchemy to work in nice way... adding ajax calls + dom manipulation.

2012-02-01

Francisco Javier Carazo Gil answers:

Hi Armand,

Maybe functions are refered to an ID of DOM that should be unique. If you are using more than one editor it could be the problem.

Look at the ID of each wp_editor.

This could be also the DOM problem that Ivaylo has notice us. To solve it you can try to call editor at the end of execution, to prevent DOM manipulation after it.