Title: support5d's Replies | WordPress.org

---

# support5d

  [  ](https://wordpress.org/support/users/support5d/)

 *   [Profile](https://wordpress.org/support/users/support5d/)
 *   [Topics Started](https://wordpress.org/support/users/support5d/topics/)
 *   [Replies Created](https://wordpress.org/support/users/support5d/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/support5d/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/support5d/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/support5d/engagements/)
 *   [Favorites](https://wordpress.org/support/users/support5d/favorites/)

 Search replies:

## Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Job Postings] Multi File Upload and restricted filetypes](https://wordpress.org/support/topic/multi-file-upload-and-restricted-filetypes/)
 *  Thread Starter [support5d](https://wordpress.org/support/users/support5d/)
 * (@support5d)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/multi-file-upload-and-restricted-filetypes/#post-15994960)
 * Hey Stefan,
 * ich hab in einem anderem Projekt eine API an die Formulare angebunden und prinzipiell
   könnte man mit mit diesem Hook sich einklinken und prüfen was für Dateien übermittelt
   worden sind. Bevor das Plugin überhaupt etwas davon mitbekommt, ist aber jetzt
   kein fertiger Code aber ein Entwickler weiß was zu machen wäre.
 * Unsere Kunden haben da bisher noch nicht so das Spam Problem gehabt, daher hab
   ich es noch nicht für nötig gehalten aktiv einzugreifen.
 * Grüße
    Danny
 *     ```
       add_action( 'wp_ajax_nopriv_jobslisting_apply_now', 'job_entry_store_tmp_files', 9);
       add_action( 'wp_ajax_jobslisting_apply_now', 'job_entry_store_tmp_files', 9);
       function job_entry_store_tmp_files(){
       	$allowed_file_types = array(
       		'png' => 'image/png',
       		'jpe' => 'image/jpeg',
       		'jpeg' => 'image/jpeg',
       		'jpg' => 'image/jpeg',
       		'gif' => 'image/gif',
       		'tiff' => 'image/tiff',
       		'tif' => 'image/tiff',
       		'pdf' => 'application/pdf',
       		'xlsx' => 'application/vnd.ms-excel',
       		'docx' => 'application/msword',
       	);
       	// Check for files extension and throw error for form
       	foreach($_FILES as $key => &$file){
       		// Grab MIME type
       		$mime_type = mime_content_type($file['tmp_name']);
       		if (! in_array($mime_type, $allowed_file_types)) {
       			// File type is NOT allowed.
       			// Throw Error msg for the the form
       		}
       	}
       }
       ```
   
    -  This reply was modified 3 years, 9 months ago by [support5d](https://wordpress.org/support/users/support5d/).
    -  This reply was modified 3 years, 9 months ago by [support5d](https://wordpress.org/support/users/support5d/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[HubSpot All-In-One Marketing - Forms, Popups, Live Chat] Contact Form loads 2 extra forms](https://wordpress.org/support/topic/contact-form-loads-2-extra-forms/)
 *  [support5d](https://wordpress.org/support/users/support5d/)
 * (@support5d)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/contact-form-loads-2-extra-forms/#post-15777866)
 * [@harthur90](https://wordpress.org/support/users/harthur90/) did not help, it
   is more a problem in the hubspot form js script. It adds all missing form container…
   just try and remove the div container, the js script adds a fall back div container
   and renders the form in it
 * `<div class="hbspt-form" id="hbspt-form-' . $form_div_uuid . '"></div>`
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[HubSpot All-In-One Marketing - Forms, Popups, Live Chat] Contact Form loads 2 extra forms](https://wordpress.org/support/topic/contact-form-loads-2-extra-forms/)
 *  [support5d](https://wordpress.org/support/users/support5d/)
 * (@support5d)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/contact-form-loads-2-extra-forms/#post-15775053)
 * Hey [@harthur90](https://wordpress.org/support/users/harthur90/) i could pinpoint
   the problem… we have 2 popups with hubspot shortcode forms in it… these are rendered&
   added invisible on all page loads
 * so the other 2 shown forms are different ones… the problem should not be the 
   shortcode rendering but more a javascript problem, cause the 2 other divs are
   invisible
 * press the “Contact us” Button in the footer and it renders correctly a fourth
   form… which is the same code like the first duplicate one. Both duplicate forms
   are not using the $form_div_uuid as the javascript target.. so it is probably
   a javascript form rendering fallback when the html target is not found…
 * Wrong: hbspt-form-e0fdeb79-f0af-48a3-9455-d9c033003a5a (UUID from the id)
    Wrong:
   hbspt-form-a4601138-f5a3-4ce7-b438-7c47f443db96 (UUID from the id) Correct: hbspt-
   form-1656346333000-2111172195 (using the numeric $form_div_uuid)
 * i created a small quick fix to hide the wrong forms, until the bug is somehow
   fixed or the plugin is updated. it replaces the return code in line 176 and IS
   NOT A PERMANENT FIX it adds a div container around the shortcode and hides all**.
   hbspt-form** besided the orignal one, which has the class **.this_is_the_correct_form**
 *     ```
       return <div class="hide_duplicate_forms_inside_this_div">
       <style>
       .hide_duplicate_forms_inside_this_div .hbspt-form {
       	display: none;
       }
       .hide_duplicate_forms_inside_this_div .this_is_the_correct_form{
       	display: block !important;
       }
       </style>
       <script>
       	window.hsFormsOnReady = window.hsFormsOnReady || [];
       	window.hsFormsOnReady.push(()=>{
       		hbspt.forms.create({
       			portalId: ' . $portal_id . ',
       			formId: "' . $id . '",
       			target: "#hbspt-form-' . $form_div_uuid . '",
       			region: "' . $hublet . '",
       			' . LeadinFilters::get_leadin_forms_payload() . '
       	})});
       	console.log("type: ' . $type . '");
       	console.log("portal_id: ' . $portal_id . '");
       	console.log("id: ' . $id . '");
       	console.log("form_div_uuid: ' . $form_div_uuid . '");
       </script>
       <div class="hbspt-form this_is_the_correct_form" id="hbspt-form-' . $form_div_uuid . '"></div></div>';
       ```
   
 * PS: I found another customer with the same bug… there is single elementor popup
   in the background so there are only 2 forms printed not 3
    [https://www.gqs-akademie.com/download-schulungskatalog/](https://www.gqs-akademie.com/download-schulungskatalog/)
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[HubSpot All-In-One Marketing - Forms, Popups, Live Chat] Contact Form loads 2 extra forms](https://wordpress.org/support/topic/contact-form-loads-2-extra-forms/)
 *  [support5d](https://wordpress.org/support/users/support5d/)
 * (@support5d)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/contact-form-loads-2-extra-forms/#post-15775009)
 * Hey [@harthur90](https://wordpress.org/support/users/harthur90/) i addded the
   code and a var_dump before the switch clause… the var_dump was only posted on
   the first form and not repeatedly
 * i removed line 27 and the raw shortcode was only printed once
 * i added a console.log() in line 190 and it printed 3 times the form_div_uuid (
   the console.log() is still enabled for debugging)
 * i played around with echo, ob_start() + return ob_get_clean()… nothing seems 
   to work…
 * (oh as a side note, on friday it only showed 2 forms… now there are 3 printed…
   black magic…)
    -  This reply was modified 3 years, 11 months ago by [support5d](https://wordpress.org/support/users/support5d/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[HubSpot All-In-One Marketing - Forms, Popups, Live Chat] Contact Form loads 2 extra forms](https://wordpress.org/support/topic/contact-form-loads-2-extra-forms/)
 *  [support5d](https://wordpress.org/support/users/support5d/)
 * (@support5d)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/contact-form-loads-2-extra-forms/#post-15774533)
 * Greetings, we are having the same problem, since last friday i think. All Plugins
   are up-to-date and the only solution is to replace all shortcodes with the javascript
   widget code.
 * As a side note, inside elementor the short code preview works fine and only one
   form is printed. The javascript embedded code works also fine
 * We tried every possible solution…
 * [https://logiplus.de/en/registration-web-seminar-recording-real-time-transparency-in-the-warehouse-is-not-magic-lp-easydashboard/](https://logiplus.de/en/registration-web-seminar-recording-real-time-transparency-in-the-warehouse-is-not-magic-lp-easydashboard/)

Viewing 5 replies - 1 through 5 (of 5 total)