wp_audio_shortcode_class
云策文档标注
概述
wp_audio_shortcode_class 是一个 WordPress 过滤器,用于修改音频短码输出容器的 CSS 类属性。它允许开发者在音频短码渲染时动态调整类名,以自定义样式或行为。
关键要点
- 过滤器名称:wp_audio_shortcode_class
- 参数:$class(字符串,CSS 类或空格分隔的类列表)和 $atts(数组,音频短码属性数组)
- 用途:在 wp_audio_shortcode() 函数中应用,用于构建音频短码输出
- 版本历史:从 WordPress 3.6.0 引入,4.9.0 版本添加了 $atts 参数
原文内容
Filters the class attribute for the audio shortcode output container.
Parameters
$classstring-
CSS class or list of space-separated classes.
$attsarray-
Array of audio shortcode attributes.
Source
$atts['class'] = apply_filters( 'wp_audio_shortcode_class', $atts['class'], $atts );