I'm new to wordpress and would like to know what's the best way of extending my custom plugin for our school page. I've created a custom post type experiment which will always have steps 1 to N. Sometimes an experiment might have 3 steps and sometimes 12 steps.

I've looked at custom fields and from the documentation the key-value storage would require always having the maximum number of fields and then checking if a key's value is empty when iterating through it inside the template.

What I'd like to do is to have ajaxed fields like there are for a normal post.

  • Why do they have to be stored individually? Store an array in a single field. – Milo Jan 9 '17 at 16:40

So I figured out that Wordpress works with arrays inside a custom post_meta by default.

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – cjbj Jan 10 '17 at 11:09
  • @cjbj this is the author. :) – Rarst Jan 10 '17 at 11:54
  • @rarst didn't see that in the review window ;-) – cjbj Jan 10 '17 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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