WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
890 | $wp_filter[$tag][$priority] = array_merge($wp_filter['all'][$priority], array()); |
891 | $wp_filter[$tag][$priority] = array_unique($wp_filter[$tag][$priority]); |
892 | } |
893 | } |
894 |
|
895 | if ( isset($wp_filter[$tag]) ) |
896 | ksort( $wp_filter[$tag] ); |
897 | } |
898 |
|
899 | function apply_filters($tag, $string) { |
900 | global $wp_filter; |
901 | |
902 | $args = array_slice(func_get_args(), 2); |
903 |
|
904 | merge_filters($tag); |
905 | |
906 | if (!isset($wp_filter[$tag])) { |
907 | return $string; |
908 | } |
Line | Code |
961 | } |
962 | } |
963 | $wp_filter[$tag]["$priority"] = $new_function_list; |
964 | } |
965 | return true; |
966 | } |
967 |
|
968 | // The *_action functions are just aliases for the *_filter functions, they take special strings instead of generic content |
969 |
|
970 | function do_action($tag, $arg = '') { |
971 | global $wp_filter; |
972 | $extra_args = array_slice(func_get_args(), 2); |
973 | if ( is_array($arg) ) |
974 | $args = array_merge($arg, $extra_args); |
975 | else |
976 | $args = array_merge(array($arg), $extra_args); |
977 | |
978 | merge_filters($tag); |
979 | |