Filter hook 'wp_video_shortcode_override'

in WP Core File wp-includes/media.php at line 3624

View Source

wp_video_shortcode_override

Filter Hook
Description
Filters the default video shortcode output. If the filtered output isn't empty, it will be used instead of generating the default video template.

Hook Information

File Location wp-includes/media.php View on GitHub
Hook Type Filter
Line Number 3624

Hook Parameters

Type Name Description
string $html Empty variable to be replaced with shortcode markup.
array $attr Attributes of the shortcode. See {@see wp_video_shortcode()}.
string $content Video shortcode content.
int $instance Unique numeric ID of this video shortcode instance.

Usage Examples

Basic Usage
<?php
// Hook into wp_video_shortcode_override
add_filter('wp_video_shortcode_override', 'my_custom_filter', 10, 4);

function my_custom_filter($html, $attr, $content, $instance) {
    // Your custom filtering logic here
    return $html;
}

Source Code Context

wp-includes/media.php:3624 - How this hook is used in WordPress core
<?php
3619  	 * @param string $html     Empty variable to be replaced with shortcode markup.
3620  	 * @param array  $attr     Attributes of the shortcode. See {@see wp_video_shortcode()}.
3621  	 * @param string $content  Video shortcode content.
3622  	 * @param int    $instance Unique numeric ID of this video shortcode instance.
3623  	 */
3624  	$override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instance );
3625  
3626  	if ( '' !== $override ) {
3627  		return $override;
3628  	}
3629  

PHP Documentation

<?php
/**
	 * Filters the default video shortcode output.
	 *
	 * If the filtered output isn't empty, it will be used instead of generating
	 * the default video template.
	 *
	 * @since 3.6.0
	 *
	 * @see wp_video_shortcode()
	 *
	 * @param string $html     Empty variable to be replaced with shortcode markup.
	 * @param array  $attr     Attributes of the shortcode. See {@see wp_video_shortcode()}.
	 * @param string $content  Video shortcode content.
	 * @param int    $instance Unique numeric ID of this video shortcode instance.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-includes/media.php
Related Hooks

Related hooks will be displayed here in future updates.