WordPress at a glance
function is not described

wp_embed_register_handler() WP 2.9.0

Registers an embed handler.

Should probably only be used for sites that do not support oEmbed.

  • Global. WP_Embed. $wp_embed

No Hooks.


Nothing (null).


wp_embed_register_handler( $id, $regex, $callback, $priority );
$id(string) (required)
An internal ID/name for the handler. Needs to be unique.
$regex(string) (required)
The regex that will be used to see if this handler should be used for a URL.
$callback(callable) (required)
The callback function that will be called if the regex is matched.
Used to specify the order in which the registered handlers will be tested.
Default: 10

Code of wp embed register handler: wp-includes/embed.php WP 5.2.2

function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
	global $wp_embed;
	$wp_embed->register_handler( $id, $regex, $callback, $priority );