From 945561f7e00ccf1464c3844688e8b113c2ad540b Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Fri, 28 Jan 2022 10:05:53 -0500 Subject: [PATCH] Add oEmbed support --- plugin.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin.php b/plugin.php index 57a38e8..8bd6ca4 100644 --- a/plugin.php +++ b/plugin.php @@ -63,6 +63,8 @@ if ( !class_exists('CognitoFormsPlugin') ) { public function init() { // Initialize Gutenberg Block $this->block_init(); + // Add support for oEmbed + $this->oembed_init(); } // Initialize plug-in @@ -148,6 +150,11 @@ if ( !class_exists('CognitoFormsPlugin') ) { public function main_page() { include 'templates/main.php'; } + + // Add support for oEmbed using the generic Gutenberg Embed block + public function oembed_init() { + wp_oembed_add_provider( '#https?://(www\.)?cognitoforms\.com/.*#i', 'https://www.cognitoforms.com/f/oembed/', true ); + } } new CognitoFormsPlugin;