smilies
云策文档标注
概述
本文档介绍了 WordPress 中的 'smilies' 过滤器,用于过滤所有表情符号。该过滤器必须在 smilies_init 运行前添加,因为它通常只运行一次来设置表情符号的正则表达式。
关键要点
- 过滤器名称:'smilies',用于过滤表情符号的十六进制表示列表。
- 参数:$wpsmiliestrans,一个数组,键为表情代码,值为对应的十六进制表示。
- 使用时机:必须在 smilies_init 函数运行前添加,以确保正确初始化。
- 相关函数:smilies_init(),用于将表情代码转换为图标图形文件。
- 版本历史:从 WordPress 4.7.0 版本引入。
代码示例
$wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans );
原文内容
Filters all the smilies.
Description
This filter must be added before smilies_init is run, as it is normally only run once to setup the smilies regex.
Parameters
$wpsmiliestransstring[]-
List of the smilies’ hexadecimal representations, keyed by their smily code.
Source
$wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans );
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |