I'm using formidable inside a plugin called woocommerce point of sale which doesn't auto load formidable forms styling and javascript, how can I load specifically the formidable css and javascript for this I've tried this:
echo "<script type='text/javascript' src='{$siteUrl}/wp-content/plugins/formidable-pro/js/frm.min.js?ver=6.21-jquery' id='formidable-js'></script>";
echo "<script type='text/javascript' src='{$siteUrl}/wp-content/plugins/formidable/js/formidable_admin_global.js?ver=6.21.1'></script>";
echo "<link rel='stylesheet' id='formidable-css' href='{$siteUrl}/wp-content/plugins/formidable/css/formidableforms.css?ver={$formidableVersion}' type='text/css' media='all'>";
echo "<link rel='stylesheet' href='{$siteUrl}/wp-content/plugins/formidable/css/admin/frm_admin_global.css?ver=6.21.1' >";
but I get errors like:
Uncaught ReferenceError: frm_js is not defined
at checkForErrorsAndMaybeSetFocus (frm.min.js?ver=6.21-jquery:45:214)
at Object.init (frm.min.js?ver=6.21-jquery:56:365)
at HTMLDocument.<anonymous> (frm.min.js?ver=6.21-jquery:68:541)
at e (jquery.min.js?ver=3.7.1:2:27028)
at jquery.min.js?ver=3.7.1:2:27330
:
I've also tried:
add_action('wp', function(){
$url = getPageUrls()['url'];
$urlInQuestion = "/point-of-sale/";
if (strpos($url, $urlInQuestion) === false) return;
FrmFormsController::enqueue_scripts(array('id' => 3));
});
:
But it didn't seem to do anything.
I've created a nifty solution, although not perfect. I took the preview url and placed it inside of an iframe element:<iframe id='updateUserFormIframe' src='<?php echo $siteUrl; ?>/wp-admin/admin-ajax.php?action=frm_forms_preview&form=edit-user-profile' style='width: 100%; height: 100%; border: none; position: absolute;' ></iframe>
Please login or Register to submit your answer