current_filter()
current_filter()
检索当前筛选器或操作的名称。
Retrieve the name of the current filter or action.
返回(Return)
(string)当前筛选器或操作的挂接名称。
源码(Source)
/** * Retrieve the name of the current filter or action. * * @since 2.5.0 * * @global array $wp_current_filter Stores the list of current filters with the current one last * * @return string Hook name of the current filter or action. */ function current_filter() { global $wp_current_filter; return end( $wp_current_filter ); }
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.5.0 | wp-includes/plugin.php:323 | 14 | 0 |
笔记(Notes)
获取当前筛选器
获取当前操作
current_filter() 为WP2原创文章,链接:https://www.wp2.cn/functions/current_filter/