current_filter()
Retrieve the name of the current filter or action.
1 time — 0.00001 sec (speed of light) | 50000 times — 0.01 sec (speed of light) | PHP 7.1.11, WP 4.9.5
No Hooks.
Return
String
. Hook name of the current filter.
Usage
current_filter();
Notes
- Global. String[]. $wp_current_filter Stores the list of current filters with the current one last
Changelog
Since 2.5.0 | Introduced. |
Code of current_filter() current filter WP 6.0
function current_filter() { global $wp_current_filter; return end( $wp_current_filter ); }