Metabox cloning via Admin Ajax call issue

1st This isn’t a WP problem, but a jQuery problem.

2nd I used to develop my own set of classes for meta box and stopped about a month a ago and dropped them in favor of the RW Meta Box library. Meta Boxes are a big issue incl. saving the data, building an endless # of field types, etc. so that it’s just easier to throw some time together and make something bigger. Currently we got 21 forks. I’d highly encourage you to jump right in. We even got clone fields and aren’t too far away from clone fieldsets.

3rd Your problem is each();. This doesn’t work with objects that aren’t created after DOM was ready (you can’t attach anything to something that doesn’t exist at this moment, right?). You could try to work with live();, but would encounter serious memory problems. Before jQuery 1.7, you should’ve used delegate(); and should now go with on();. Just take a look at the js file clones.js in the RW Meta Box library for a how-to if you still want to develop your own.


P.s.: Fork is ♥ – I’d really appreciate if you could invest your efforts over there, as we’re – like I mentioned above – still missing field group cloning.

P.p.s.: Surroundings If you stick with RW Meta Box: GitHub Team has been so nice and even sponsered us a free Account at TenderApp. So we have a support channels and a pretty kool KnowledgeBase too. 🙂

Leave a Comment