Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: {$tag}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
1228                     $wp_filter[$tag][$priority] = array_merge($wp_filter['all'][$priority], array());
1229                $wp_filter[$tag][$priority] = array_unique($wp_filter[$tag][$priority]);
1230           }
1231      }
1232
1233      if ( isset($wp_filter[$tag]) )
1234           uksort( $wp_filter[$tag], "strnatcasecmp" );
1235 }
1236
1237 function apply_filters($tag, $string) {
1238      global $wp_filter;
1239
1240      $args = array_slice(func_get_args(), 2);
1241
1242      merge_filters($tag);
1243
1244      if ( !isset($wp_filter[$tag]) ) {
1245           return $string;
1246      }
 
Line Code
1299                }
1300           }
1301           $wp_filter[$tag]["$priority"] = $new_function_list;
1302      }
1303      return true;
1304 }
1305
1306 // The *_action functions are just aliases for the *_filter functions, they take special strings instead of generic content
1307
1308 function do_action($tag, $arg = '') {
1309      global $wp_filter;
1310      $extra_args = array_slice(func_get_args(), 2);
1311       if ( is_array($arg) )
1312            $args = array_merge($arg, $extra_args);
1313      else
1314           $args = array_merge(array($arg), $extra_args);
1315
1316      merge_filters($tag);
1317