{"id":18254834,"date":"2025-01-20T19:08:22","date_gmt":"2025-01-20T19:08:22","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/replacing-custom-html-code\/"},"modified":"2025-01-20T19:08:22","modified_gmt":"2025-01-20T19:08:22","slug":"replacing-custom-html-code","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/replacing-custom-html-code\/","title":{"rendered":"Replacing custom HTML code"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Divi page builder does not use an <code>iframe<\/code> for Google Maps, rather it invokes custom JS code that includes several <code>div<\/code> elements in the page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This conflicts with the usual (expected) behavior of the plugin which only targets frame elements and embeds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nevertheless, even super simple expressions such as <code>&lt;p&gt;HELLO&lt;.p&gt;<\/code> are not replacing the <code>&lt;p&gt;HELLO&lt;\/p&gt;<\/code> paragraph in my test page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How can I ensure that a custom embed provider, added from the WP backend, replaces some HTML code correctly?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you!<\/p>\n","protected":false},"template":"","class_list":["post-18254834","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18254834","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\/18254834\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18254834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}