[wp-trac] [WordPress Trac] #60182: Add Gumlet.com to oEmbed allowlist

WordPress Trac noreply at wordpress.org
Thu Feb 15 06:45:07 UTC 2024


#60182: Add Gumlet.com to oEmbed allowlist
-------------------------+-----------------------------
 Reporter:  akbansa      |       Owner:  akbansa
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  Future Release
Component:  Embeds       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+-----------------------------

Comment (by zecydfng77):

 To add Gumlet.com to the oEmbed allowlist in WordPress, you can use the
 `wp_oembed_add_provider()` function to register Gumlet as an oEmbed
 provider. Here's how you can do it:

 ```php
 function add_gumlet_oembed_provider() {
     wp_oembed_add_provider( '#https?://(?:www\.)?gumlet\.com/watch/.*#i',
 'https://api.gumlet.com/v1/oembed', true );
     wp_oembed_add_provider(
 '#https?://(?:www\.)?play\.gumlet\.io/embed/.*#i',
 'https://api.gumlet.com/v1/oembed', true );
 }
 add_action( 'init', 'add_gumlet_oembed_provider' );
 ```

 Place this code in your theme's `functions.php` file or in a custom
 plugin. This code registers Gumlet.com as an oEmbed provider for URLs
 matching the specified patterns.

 Now, WordPress will attempt to fetch oEmbed data from Gumlet.com URLs, and
 you should be able to embed Gumlet videos using the standard oEmbed syntax
 in the WordPress editor.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60182#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list