WordPress at a glance

current_filter() WP 1.0

Retrieve the name of the current filter or action.

1 time = 0.00001s = speed of light | 50000 times = 0.01s = speed of light | PHP 7.1.11, WP 4.9.5

No Hooks.

Return

String. Hook name of the current filter or action.

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() WP 5.6

<?php
function current_filter() {
	global $wp_current_filter;
	return end( $wp_current_filter );
}

From tag: Filters (hooks)

More from category: Hooks (actions, filters)

No comments
    Log In