Add oEmbed support

This commit is contained in:
Michael Thomas 2022-01-28 10:05:53 -05:00
parent 429fee8a03
commit 945561f7e0
1 changed files with 7 additions and 0 deletions

View File

@ -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;