Add oEmbed support
This commit is contained in:
		@@ -63,6 +63,8 @@ if ( !class_exists('CognitoFormsPlugin') ) {
 | 
				
			|||||||
		public function init() {
 | 
							public function init() {
 | 
				
			||||||
			// Initialize Gutenberg Block
 | 
								// Initialize Gutenberg Block
 | 
				
			||||||
			$this->block_init();
 | 
								$this->block_init();
 | 
				
			||||||
 | 
								// Add support for oEmbed
 | 
				
			||||||
 | 
								$this->oembed_init();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Initialize plug-in
 | 
							// Initialize plug-in
 | 
				
			||||||
@@ -148,6 +150,11 @@ if ( !class_exists('CognitoFormsPlugin') ) {
 | 
				
			|||||||
		public function main_page() {
 | 
							public function main_page() {
 | 
				
			||||||
			include 'templates/main.php';
 | 
								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;
 | 
						new CognitoFormsPlugin;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user