Showing custom oEmbed preview outputs in Gutenberg
-
Hi there,
I’m trying to display custom oEmbed preview outputs in the block editor but to no avail.
For example, by adding code like this, and enter the url
https://abc.somewhere.com/foo/bar
in the Gutenberg block editor, it appears that it attempts to find embeddable elements and but it does not display any preview. So the user would think it failed. On the other hand, in the front-end of the post, the custom output is certainly displayed.wp_embed_register_handler( "test_oembed", "#https?://([a-z0-9-]+\.)?somewhere\.com/.*#i", "getOutputOfSomewhere" ); function getOutputOfSomewhere( $matches, $attributes, $url, $raw_attributes ) { return "<pre>" . "<h3>Custom oEmbed Output</h3>" . "<p>This is a test.</p>" . "</pre>"; }
I’m looking for a way to display custom oEmbed preview outputs in Gutenberg.
Does anybody know how? Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Showing custom oEmbed preview outputs in Gutenberg’ is closed to new replies.