current_filter()
Retrieve the name of the current filter or action.
描述
返回值
(string) Hook name of the current filter or action.
源代码
File: wp-includes/plugin.php
function current_filter() {
global $wp_current_filter;
return end( $wp_current_filter );
}
更新日志
Version | 描述 |
---|---|
2.5.0 | Introduced. |
相关函数
Used By
-
wp-admin/includes/class-language-pack-upgrader.php:
Language_Pack_Upgrader::bulk_upgrade() -
wp-admin/includes/plugin-install.php:
display_plugins_table() -
wp-includes/formatting.php:
capital_P_dangit() -
wp-includes/general-template.php:
get_the_generator() -
wp-includes/kses.php:
wp_kses_data() -
wp-includes/kses.php:
wp_filter_kses() -
wp-includes/query.php:
is_main_query() -
wp-includes/functions.wp-scripts.php:
wp_deregister_script() -
wp-includes/update.php:
wp_update_plugins() -
wp-includes/update.php:
wp_update_themes() -
wp-includes/plugin.php:
current_action() -
wp-includes/class-wp-customize-widgets.php:
WP_Customize_Widgets::capture_filter_pre_get_option()
Show 7 more used by
Hide more used by
User Contributed Notes
-
Skip to note content
You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note
Contributed by
Codex
Get the current filter
function wpdocs_my_filter() { echo current_filter(); // 'the_content' } add_filter( 'the_content', 'wpdocs_my_filter' );
Get the current action
function wpdocs_my_init_function() {
echo current_filter(); // 'init'
}
add_action( 'init', 'wpdocs_my_init_function' );
你可能对这些文章感兴趣:
- wordpress函数get_all_post_type_supports()用法示例
- wordpress函数get_all_user_settings()用法示例
- wordpress函数get_all_category_ids()用法示例
- wordpress函数get_all_page_ids()用法示例
- wordpress函数get_allowed_mime_types()用法示例
- wordpress函数get_allowed_themes()用法示例
- wordpress函数get_alloptions_110()用法示例
- wordpress函数get_allowed_http_origins()用法示例
- wordpress函数get_alloptions()用法示例
- wordpress函数get_admin_users_for_domain()用法示例
- wordpress函数get_admin_page_title()用法示例
- wordpress函数get_admin_url()用法示例
- wordpress函数get_admin_page_parent()用法示例
- wordpress函数get_adjacent_post_rel_link()用法示例
如有疑问,请前往问答中心反馈!
反馈