Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This question is an exact duplicate of:

I have certain blocks of code like BlockA(a,b,c) and BlockB(b,d,e) and so on where these a,b,c, etc.. are all input fields. All these blocks are hidden initially with css and post editor has the choice to load as many blocks in the order they want. My idea was to fit all these into a single metabox for custom post type. Right now, i can create those blocks dynamically using jQuery but when i click Wordpress update/publish button or i revisit the page again all the dynamically created blocks just disappear. Can someone suggest me a way to solve this issue?

Thanks very much in advance for your help.

share|improve this question
add comment

marked as duplicate by kaiser, s_ha_dum, brasofilo, toscho Jul 8 '13 at 13:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Looks like you try to add repeatable and sortable write panels to a specific CPT like shown here:

WordPress SimpleFields Plugin

As this task isn't that simple to answer in a few words, maybe Simple Fields can handle that for you: http://simple-fields.com/ .

For a custom solution you should have a look at: http://www.farinspace.com/wpalchemy-metabox/ .

share|improve this answer
thank you very much for your response. I tried ACF and have to drop in the middle because it doesn't allow the user(in this case the editor) to add fields as they wish.I haven't tried simple fields yet and the same with wpalchemy. I am scared to try these solutions primarily because after i start building the app and realize that i cannot achieve what i want with this plugin or class. So i am trying to develop my solution from scratch. In this regard, do you have any thing to suggest? Thanks once again for your suggestion. Much appreciated. –  sri Jul 2 '13 at 10:44
Ok, then you have to give some more explanation. Should every block contain the same inputfields? O –  rfrq Jul 2 '13 at 10:55
Does BlockA(a,b,c) mean a repeateble given inputfieldcombination which the author has to fill in? Like Products (Name, Quantity, Price). Or should the authors be able to create their custom blocks on the fly in edit mode an repeat that inputfieldcombination? –  rfrq Jul 2 '13 at 11:04
Let me explain: I have about 10 blocks with each block having 3 to 10 input fields. The type of input field for all the blocks may or may not be the same but the values stored are different for different blocks. My example: I have to develop a manufacturing process application which will be used by project manager to create different stages that are involved in a particular manufacturing job. There are about 10 stages but combinations of those stages for each job are unbelievable. Like i said before i am able to achieve this with jquery but they are not getting saved. –  sri Jul 2 '13 at 11:10
Yes, they should be able to create those blocks on the fly which is now achievable with jQuery. But not able to save all those blocks that have been created on the fly and their data. –  sri Jul 2 '13 at 11:13
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.