Add oEmbed support
This commit is contained in:
parent
429fee8a03
commit
945561f7e0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue