wp_embed_handler_video
Filters the video embed output.
Description
Parameters (4)
- 0. $video (string)
- Video embed output.
- 1. $attr (array)
- An array of embed attributes.
- 2. $url (string)
- The original URL that was matched by the regex.
- 3. $rawattr (array)
- The original unmodified attributes.
Usage
- To run the hook, copy the example below.
- $video = apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr );
- if ( !empty( $video ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_embed_handler_video callback
- function filter_wp_embed_handler_video( $video, $attr, $url, $rawattr ) {
- // make filter magic happen here...
- return $video;
- };
- // add the filter
- add_filter( 'wp_embed_handler_video', 'filter_wp_embed_handler_video', 10, 4 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wp_embed_handler_video', 'filter_wp_embed_handler_video', 10, 4 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/embed.php
- return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr );