wp_video_shortcode
Filter HookDescription
Filters the output of the video shortcode.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3853 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$output
|
Video shortcode HTML output. |
array
|
$atts
|
Array of video shortcode attributes. |
string
|
$video
|
Video file. |
int
|
$post_id
|
Post ID. |
string
|
$library
|
Media library used for the video shortcode. |
Usage Examples
Basic Usage
<?php
// Hook into wp_video_shortcode
add_filter('wp_video_shortcode', 'my_custom_filter', 10, 5);
function my_custom_filter($output, $atts, $video, $post_id, $library) {
// Your custom filtering logic here
return $output;
}
Source Code Context
wp-includes/media.php:3853
- How this hook is used in WordPress core
<?php
3848 * @param array $atts Array of video shortcode attributes.
3849 * @param string $video Video file.
3850 * @param int $post_id Post ID.
3851 * @param string $library Media library used for the video shortcode.
3852 */
3853 return apply_filters( 'wp_video_shortcode', $output, $atts, $video, $post_id, $library );
3854 }
3855 add_shortcode( 'video', 'wp_video_shortcode' );
3856
3857 /**
3858 * Gets the previous image link that has the same post parent.
PHP Documentation
<?php
/**
* Filters the output of the video shortcode.
*
* @since 3.6.0
*
* @param string $output Video shortcode HTML output.
* @param array $atts Array of video shortcode attributes.
* @param string $video Video file.
* @param int $post_id Post ID.
* @param string $library Media library used for the video shortcode.
*/
Quick Info
- Hook Type: Filter
- Parameters: 5
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.