{"id":2987,"date":"2023-07-23T17:45:57","date_gmt":"2023-07-23T20:45:57","guid":{"rendered":"https:\/\/felipeelia.com.br\/?p=2987"},"modified":"2023-07-25T12:55:16","modified_gmt":"2023-07-25T15:55:16","slug":"contact-form-7-repeatable-fields-2-0-0","status":"publish","type":"post","link":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/","title":{"rendered":"Contact Form 7 \u2013 Repeatable Fields 2.0.0"},"content":{"rendered":"\n

Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7<\/a>. I learned a lot of different things with it and it was one of the code samples I sent during the 10up recruiting process<\/a>. I even remember staying up all night to make it more presentable!<\/p>\n\n\n\n

I was hired by 10up<\/a>, the pandemic hit and I never went back to the plugin. A few people reached out asking, but it just wasn’t on my radar anymore. Recently, an update to Contact Form 7 broke the repeated fields validation and I decided it was time to go back.<\/p>\n\n\n\n

Even if I tried, I can’t explain how much I’ve learned over the last few years, mostly leading ElasticPress<\/a> development. As free time is rare, I decided to implement the most basic things first and release a new version of my plugin.<\/p>\n\n\n\n

In addition to fixing that validation error, this version changes a few other things. For me, the main ones are:<\/p>\n\n\n\n

    \n
  1. Unit tests:<\/strong> for now it only has a very basic test, but the most important thing is that the foundation is already there, running the tests at each commit<\/em> of a Pull Request. Now it’s just a matter of writing more tests.<\/li>\n\n\n\n
  2. Better documentation:<\/strong> in this version, I moved the documentation to GitHub’s Wiki<\/a>. In the near future, part of it will be automatically generated from comments in the code.<\/li>\n\n\n\n
  3. Support:<\/strong> I’ve decided that I will only offer support on GitHub. I created new templates for issues<\/em>, forcing users who want to report a bug<\/a> to provide plugin-specific data.<\/li>\n\n\n\n
  4. Script minification<\/em><\/strong>: the plugin only has a .js<\/em> file, which was previously minified<\/em> with Grunt. I switched to wp-scripts<\/a> instead.<\/li>\n<\/ol>\n\n\n\n

    In the near future, I also intend to implement end-to-end<\/em> tests, probably using Cypress. For this, I’ve added support for wp-env<\/a> already.<\/p>\n\n\n\n

    The version wasn’t even released and I already have a regret: as I did a lot of things in a hurry and alone, I ended up committing<\/em> some things mixed up and directly on the trunk<\/em> branch. Then I tried to be more disciplined and open Pull Requests, but I didn’t have the patience to document everything properly. As the basics are already done, from now on it will be easier to do it right \ud83d\ude09<\/p>\n\n\n\n

    For those who want to check it out, the plugin repository is at https:\/\/github.com\/felipeelia\/cf7-repeatable-fields<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

    Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7. I learned a lot of different things with it and it was one of the code samples I sent during the 10up recruiting process. I even remember staying up all night to make it more presentable! I was hired […]<\/p>\n","protected":false},"author":1,"featured_media":928,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[219,197,91],"tags":[],"yoast_head":"\nContact Form 7 \u2013 Repeatable Fields 2.0.0 | Felipe Elia<\/title>\n<meta name=\"description\" content=\"Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7. I learned a lot of different things with it and it was one of the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Contact Form 7 \u2013 Repeatable Fields 2.0.0 | Felipe Elia\" \/>\n<meta property=\"og:description\" content=\"Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7. I learned a lot of different things with it and it was one of the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/\" \/>\n<meta property=\"og:site_name\" content=\"Felipe Elia\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/felipe.elia\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/felipe.elia\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-23T20:45:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-25T15:55:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/felipeelia.com.br\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Felipe Elia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/felipe_elia\" \/>\n<meta name=\"twitter:site\" content=\"@felipe_elia\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Felipe Elia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/\"},\"author\":{\"name\":\"Felipe Elia\",\"@id\":\"https:\/\/felipeelia.com.br\/#\/schema\/person\/927a99b6e1cde7fcf9f4f79a1638b292\"},\"headline\":\"Contact Form 7 \u2013 Repeatable Fields 2.0.0\",\"datePublished\":\"2023-07-23T20:45:57+00:00\",\"dateModified\":\"2023-07-25T15:55:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/\"},\"wordCount\":401,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/felipeelia.com.br\/#\/schema\/person\/927a99b6e1cde7fcf9f4f79a1638b292\"},\"articleSection\":[\"CF7 - Repeatable Fields\",\"Open Source\",\"WordPress\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/\",\"url\":\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/\",\"name\":\"Contact Form 7 \u2013 Repeatable Fields 2.0.0 | Felipe Elia\",\"isPartOf\":{\"@id\":\"https:\/\/felipeelia.com.br\/#website\"},\"datePublished\":\"2023-07-23T20:45:57+00:00\",\"dateModified\":\"2023-07-25T15:55:16+00:00\",\"description\":\"Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7. I learned a lot of different things with it and it was one of the\",\"breadcrumb\":{\"@id\":\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/felipeelia.dev\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Contact Form 7 \u2013 Repeatable Fields 2.0.0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/felipeelia.com.br\/#website\",\"url\":\"https:\/\/felipeelia.com.br\/\",\"name\":\"Felipe Elia\",\"description\":\"Programa\u00e7\u00e3o com WordPress de um jeito f\u00e1cil, do b\u00e1sico ao avan\u00e7ado\",\"publisher\":{\"@id\":\"https:\/\/felipeelia.com.br\/#\/schema\/person\/927a99b6e1cde7fcf9f4f79a1638b292\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/felipeelia.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-BR\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/felipeelia.com.br\/#\/schema\/person\/927a99b6e1cde7fcf9f4f79a1638b292\",\"name\":\"Felipe Elia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/felipeelia.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/felipeelia.dev\/wp-content\/uploads\/2023\/06\/avatar-400x400-1.jpg\",\"contentUrl\":\"https:\/\/felipeelia.dev\/wp-content\/uploads\/2023\/06\/avatar-400x400-1.jpg\",\"width\":400,\"height\":400,\"caption\":\"Felipe Elia\"},\"logo\":{\"@id\":\"https:\/\/felipeelia.com.br\/#\/schema\/person\/image\/\"},\"description\":\"Associate Director of Platform Engineering na 10up, WordPress Core Contributor, Global Polyglots Mentor na comunidade internacional do WordPress e Locale Manager na comunidade WordPress Brasil.\",\"sameAs\":[\"https:\/\/www.facebook.com\/felipe.elia\",\"https:\/\/www.instagram.com\/felipe.elia\/\",\"https:\/\/www.linkedin.com\/in\/felipeelia\/\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/felipe_elia\",\"https:\/\/www.youtube.com\/channel\/UCD_26rOE3ClALcZreTkyIoQ\"],\"url\":\"https:\/\/felipeelia.com.br\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Contact Form 7 \u2013 Repeatable Fields 2.0.0 | Felipe Elia","description":"Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7. I learned a lot of different things with it and it was one of the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/","og_locale":"pt_BR","og_type":"article","og_title":"Contact Form 7 \u2013 Repeatable Fields 2.0.0 | Felipe Elia","og_description":"Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7. I learned a lot of different things with it and it was one of the","og_url":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/","og_site_name":"Felipe Elia","article_publisher":"https:\/\/www.facebook.com\/felipe.elia","article_author":"https:\/\/www.facebook.com\/felipe.elia","article_published_time":"2023-07-23T20:45:57+00:00","article_modified_time":"2023-07-25T15:55:16+00:00","og_image":[{"width":"1200","height":"630","url":"https:\/\/felipeelia.com.br\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png","type":"image\/png"}],"author":"Felipe Elia","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/felipe_elia","twitter_site":"@felipe_elia","twitter_misc":{"Escrito por":"Felipe Elia","Est. tempo de leitura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/#article","isPartOf":{"@id":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/"},"author":{"name":"Felipe Elia","@id":"https:\/\/felipeelia.com.br\/#\/schema\/person\/927a99b6e1cde7fcf9f4f79a1638b292"},"headline":"Contact Form 7 \u2013 Repeatable Fields 2.0.0","datePublished":"2023-07-23T20:45:57+00:00","dateModified":"2023-07-25T15:55:16+00:00","mainEntityOfPage":{"@id":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/"},"wordCount":401,"commentCount":0,"publisher":{"@id":"https:\/\/felipeelia.com.br\/#\/schema\/person\/927a99b6e1cde7fcf9f4f79a1638b292"},"articleSection":["CF7 - Repeatable Fields","Open Source","WordPress"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/","url":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/","name":"Contact Form 7 \u2013 Repeatable Fields 2.0.0 | Felipe Elia","isPartOf":{"@id":"https:\/\/felipeelia.com.br\/#website"},"datePublished":"2023-07-23T20:45:57+00:00","dateModified":"2023-07-25T15:55:16+00:00","description":"Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7. I learned a lot of different things with it and it was one of the","breadcrumb":{"@id":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/felipeelia.dev\/contact-form-7-repeatable-fields-2-0-0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/felipeelia.dev\/"},{"@type":"ListItem","position":2,"name":"Contact Form 7 \u2013 Repeatable Fields 2.0.0"}]},{"@type":"WebSite","@id":"https:\/\/felipeelia.com.br\/#website","url":"https:\/\/felipeelia.com.br\/","name":"Felipe Elia","description":"Programa\u00e7\u00e3o com WordPress de um jeito f\u00e1cil, do b\u00e1sico ao avan\u00e7ado","publisher":{"@id":"https:\/\/felipeelia.com.br\/#\/schema\/person\/927a99b6e1cde7fcf9f4f79a1638b292"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/felipeelia.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-BR"},{"@type":["Person","Organization"],"@id":"https:\/\/felipeelia.com.br\/#\/schema\/person\/927a99b6e1cde7fcf9f4f79a1638b292","name":"Felipe Elia","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/felipeelia.com.br\/#\/schema\/person\/image\/","url":"https:\/\/felipeelia.dev\/wp-content\/uploads\/2023\/06\/avatar-400x400-1.jpg","contentUrl":"https:\/\/felipeelia.dev\/wp-content\/uploads\/2023\/06\/avatar-400x400-1.jpg","width":400,"height":400,"caption":"Felipe Elia"},"logo":{"@id":"https:\/\/felipeelia.com.br\/#\/schema\/person\/image\/"},"description":"Associate Director of Platform Engineering na 10up, WordPress Core Contributor, Global Polyglots Mentor na comunidade internacional do WordPress e Locale Manager na comunidade WordPress Brasil.","sameAs":["https:\/\/www.facebook.com\/felipe.elia","https:\/\/www.instagram.com\/felipe.elia\/","https:\/\/www.linkedin.com\/in\/felipeelia\/","https:\/\/twitter.com\/https:\/\/twitter.com\/felipe_elia","https:\/\/www.youtube.com\/channel\/UCD_26rOE3ClALcZreTkyIoQ"],"url":"https:\/\/felipeelia.com.br\/author\/admin\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png",1200,630,false],"thumbnail":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields-150x150.png",150,150,true],"medium":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields-300x158.png",300,158,true],"medium_large":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields-768x403.png",768,403,true],"large":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields-1024x538.png",1024,538,true],"1536x1536":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png",1200,630,false],"2048x2048":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png",1200,630,false],"ocean-thumb-m":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png",600,315,false],"ocean-thumb-ml":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png",800,420,false],"ocean-thumb-l":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png",1200,630,false],"yarpp-thumbnail":["https:\/\/felipeelia.dev\/wp-content\/uploads\/2018\/03\/cf7-repeatable-fields.png",120,63,false]},"uagb_author_info":{"display_name":"Felipe Elia","author_link":"https:\/\/felipeelia.com.br\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Back in 2018, I created a small plugin to create repeatable fields in Contact Form 7. I learned a lot of different things with it and it was one of the code samples I sent during the 10up recruiting process. I even remember staying up all night to make it more presentable! I was hired…","_links":{"self":[{"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/posts\/2987"}],"collection":[{"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/comments?post=2987"}],"version-history":[{"count":0,"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/posts\/2987\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/media\/928"}],"wp:attachment":[{"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/media?parent=2987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/categories?post=2987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/felipeelia.dev\/wp-json\/wp\/v2\/tags?post=2987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}