• Resolved ImageLazza

    (@lazza)


    The Divi page builder does not use an iframe for Google Maps, rather it invokes custom JS code that includes several div elements in the page.

    This conflicts with the usual (expected) behavior of the plugin which only targets frame elements and embeds.

    I am trying to add a custom provider and, for the sake of testing, I am attempting to use very simple HTML regular expressions to replace some code with the Embed Privacy code. After this first test will be completed successfully, I will update the regex to match the div containing the actual map.

    Nevertheless, even super simple expressions such as <p>HELLO<.p> are not replacing the <p>HELLO</p> paragraph in my test page.

    How can I ensure that a custom embed provider, added from the WP backend, replaces some HTML code correctly?

    Thank you!

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ImageMatthias Kittsteiner

    (@kittmedia)

    Hi @lazza!

    Not matching the paragraph while using the regular expression /<p>Hello<\/p>/ is actually a bug, which I could reproduce and will fix in the next version, thank you for noting (this happens if the regular expression contains an HTML tag other than iframe, object or embed, which is then handled differently).

    Loading the Google Maps script properly is a whole different story. There’s definitely custom PHP and JavaScript code required to actually load the script only if consent is given. I’ll add it to the list of upcoming features, as I couldn’t get it fully working the last hour.

    Best regards,
    Matthias

    Thread Starter ImageLazza

    (@lazza)

    Thank you for the quick reply!

    There’s definitely custom PHP and JavaScript code required to actually load the script only if consent is given.

    This is understandable. I don’t mind if I have to write some custom code snippet to get it all right.

    Plugin Author ImageMatthias Kittsteiner

    (@kittmedia)

    I’ve released version 1.10.10, which includes both fixes: handling regular expressions and loading Google Maps in Divi.

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

The topic ‘Replacing custom HTML code’ is closed to new replies.