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 |
---|---|
1156 | $wp_filter[$tag][$priority] = array_merge($wp_filter['all'][$priority], array()); |
1157 | $wp_filter[$tag][$priority] = array_unique($wp_filter[$tag][$priority]); |
1158 | } |
1159 | } |
1160 |
|
1161 | if ( isset($wp_filter[$tag]) ) |
1162 | ksort( $wp_filter[$tag] ); |
1163 | } |
1164 |
|
1165 | function apply_filters($tag, $string) { |
1166 | global $wp_filter; |
1167 |
|
1168 | $args = array_slice(func_get_args(), 2); |
1169 |
|
1170 | merge_filters($tag); |
1171 |
|
1172 | if ( !isset($wp_filter[$tag]) ) { |
1173 | return $string; |
1174 | } |
Line | Code |
1226 | } |
1227 | } |
1228 | $wp_filter[$tag]["$priority"] = $new_function_list; |
1229 | } |
1230 | return true; |
1231 | } |
1232 |
|
1233 | // The *_action functions are just aliases for the *_filter functions, they take special strings instead of generic content |
1234 |
|
1235 | function do_action($tag, $arg = '') { |
1236 | global $wp_filter; |
1237 | $extra_args = array_slice(func_get_args(), 2); |
1238 | if ( is_array($arg) ) |
1239 | $args = array_merge($arg, $extra_args); |
1240 | else |
1241 | $args = array_merge(array($arg), $extra_args); |
1242 |
|
1243 | merge_filters($tag); |
1244 |
|