wp_video_shortcode_class
Filter HookDescription
Filters the class attribute for the video shortcode output container.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3758 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$class
|
CSS class or list of space-separated classes. |
array
|
$atts
|
Array of video shortcode attributes. |
Usage Examples
Basic Usage
<?php
// Hook into wp_video_shortcode_class
add_filter('wp_video_shortcode_class', 'my_custom_filter', 10, 2);
function my_custom_filter($class, $atts) {
// Your custom filtering logic here
return $class;
}
Source Code Context
wp-includes/media.php:3758
- How this hook is used in WordPress core
<?php
3753 * @since 4.9.0 The `$atts` parameter was added.
3754 *
3755 * @param string $class CSS class or list of space-separated classes.
3756 * @param array $atts Array of video shortcode attributes.
3757 */
3758 $atts['class'] = apply_filters( 'wp_video_shortcode_class', $atts['class'], $atts );
3759
3760 $html_atts = array(
3761 'class' => $atts['class'],
3762 'id' => sprintf( 'video-%d-%d', $post_id, $instance ),
3763 'width' => absint( $atts['width'] ),
PHP Documentation
<?php
/**
* Filters the class attribute for the video shortcode output container.
*
* @since 3.6.0
* @since 4.9.0 The `$atts` parameter was added.
*
* @param string $class CSS class or list of space-separated classes.
* @param array $atts Array of video shortcode attributes.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.