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;