{"id":14309389,"date":"2021-04-12T18:44:18","date_gmt":"2021-04-12T18:44:18","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/dropzonejs-hook\/"},"modified":"2021-04-12T18:44:18","modified_gmt":"2021-04-12T18:44:18","slug":"dropzonejs-hook","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/dropzonejs-hook\/","title":{"rendered":"DropZoneJS hook"},"content":{"rendered":"<p>Hi All,<\/p>\n<p>I&#8217;m trying to use dropzonejs on a the frontend. When I enqueued the script and css, the dropzonejs form worked without out calling an instance. By work, I could drag files into the dropzone and they were uploaded to the upload folder structure. The issue I&#8217;m having is hooking into the script and modifying the variables, as well as capture the file data so that I can add them to the media library and attach to a specific post. When I try to hook the name Dropzone, it says it doesn&#8217;t exist, but that is the name every reference I&#8217;ve found utilizes. Does WordPress have a built in hook with a different name?<\/p>\n<pre><code>&lt;div id=&quot;fancy-contact-form&quot;&gt;\n  &lt;form action=&quot;?step=review&amp;id=&lt;?=$_GET[&#039;id&#039;]?&gt;&quot; method=&quot;post&quot; class=&quot;dropzone dz-clickable&quot; enctype=&quot;multipart\/form-data&quot;&gt;\n    &lt;div class=&quot;dz-default dz-message&quot;&gt;&lt;span&gt;Drop files here to upload&lt;\/span&gt;&lt;\/div&gt;\n    &lt;input type=&quot;hidden&quot; name=&quot;submitted&quot; value=&quot;1&quot;&gt;\n    &lt;p align=&quot;right&quot;&gt;&lt;input type=&quot;Submit&quot; value=&quot;Upload files&quot;&gt;&lt;\/p&gt;\n  &lt;\/form&gt;\n&lt;\/div&gt;\n\n&lt;script type=&#039;text\/javascript&#039;&gt;\n    window.onload = function() {\n        Dropzone.autoDiscover = false;\n        Dropzone.options.dropzoneForm = {\n            autoProcessQueue: false,\n            parallelUploads: 10, \n            addRemoveLinks: true,\n            init: function() {\n               myDropzone = this;\n            }\n        }\n    }\n&lt;\/script&gt;<\/code><\/pre>\n<p>I&#8217;m using WP 5.7.<\/p>\n<p>Thank you.<\/p>\n<p>-Ron<\/p>\n","protected":false},"template":"","class_list":["post-14309389","topic","type-topic","status-publish","hentry","topic-tag-dropzone"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14309389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14309389\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14309389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}