WP_Embed::register_handler() – Registers an embed handler.

You appear to be a bot. Output may be restricted


Registers an embed handler.

Do not use this function directly, use wp_embed_register_handler() instead. This function should probably also only be used for sites that do not support oEmbed.


WP_Embed::register_handler( $id, $regex, $callback, $priority );


( string ) required – An internal ID/name for the handler. Needs to be unique.
( string ) required – The regex that will be used to see if this handler should be used for a URL.
( callable ) required – The callback function that will be called if the regex is matched.
( int ) optional default: 10 – Optional. Used to specify the order in which the registered handlers will be tested. Lower numbers correspond with earlier testing, and handlers with the same priority are tested in the order in which they were added to the action. Default 10.




File name: wordpress/wp-includes/class-wp-embed.php

1 to 6 of 6
  public function register_handler( $id, $regex, $callback, $priority = 10 ) {
    $this->handlers[ $priority ][ $id ] = array(
      'regex'    => $regex,
      'callback' => $callback,

 View on GitHub View on Trac