• Resolved anthonyflibustiers

    (@anthonyflibustiers)


    Hello,

    I’m working on a form witch has to display an adobe iframe catalogue. The odd thing is it only works when i’m logged to my wordpress.

    As I inspect the code the div is empty.

    I’ve tried the mu-plugin but it doesnt work as well.

    If you look at the page, it’s supposed to be on the right of “liste des pièces et quantités” when the chekbox “commander des pièces” is checked.

    The #id of the div is html-1.

    Thx !

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @anthonyflibustiers !

    Hope you’re having a good day!

    Adding iframe elements is prevented and enforced by WordPress (and plugins need to adhere to that), that’s why it’s being removed. Administrators can still see it though.

    Can you try the following mu-plugin?

    <?php
    if ( ! function_exists( 'wpmudev_forminator_enable_iframe' ) ) {
    
    	function wpmudev_forminator_enable_iframe() {
    
    		$form_exists = has_shortcode( get_the_content(), 'forminator_form' );
    		if ( $form_exists ) {
    			?>
            <script type="text/javascript">
            (($, d) => {
                $(d).ready(function() {
                    $("#html-1").html('<iframe style="border: none;" src="Please add you source here" width="100%" height="400"></iframe>');
                });
            })(jQuery, document);
            </script>
    <?php
    		}
    	}
    	add_action(
    		'wp_footer',
    		'wpmudev_forminator_enable_iframe',
    		10
    	);
    }
    

    Please replace the iframe code with yours.

    To install:
    – copy the code to a .php file with any name
    – upload the file to wp-content/mu-plugins

    Kind regards,
    Pawel

    Thread Starter anthonyflibustiers

    (@anthonyflibustiers)

    Hello Pawel,

    It works, thx !

    Regards

    Thread Starter anthonyflibustiers

    (@anthonyflibustiers)

    Resolved !

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘doesn’t show up’ is closed to new replies.