On this page
wp_embed_register_handler( string $id, string $regex, callable $callback, int $priority = 10 )
Registers an embed handler.
Description
Should probably only be used for sites that do not support oEmbed.
Parameters
$idstring Required-
An internal ID/name for the handler. Needs to be unique.
$regexstring Required-
The regex that will be used to see if this handler should be used for a URL.
$callbackcallable Required-
The callback function that will be called if the regex is matched.
$priorityint Optional-
Used to specify the order in which the registered handlers will be tested.
Default:
10
Source
File: wp-includes/embed.php. View all references
function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
global $wp_embed;
$wp_embed->register_handler( $id, $regex, $callback, $priority );
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Embed::register_handler() wp-includes/class-wp-embed.php | Registers an embed handler. |
Used By
| Used By | Description |
|---|---|
| wp_maybe_load_embeds() wp-includes/embed.php | Determines if default embed handlers should be loaded. |
Changelog
| Version | Description |
|---|---|
| 2.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_embed_register_handler