Ticket #19203: plugin.diff
| File plugin.diff, 1.9 KB (added by amereservant, 19 months ago) |
|---|
-
wp-includes/plugin.php
22 22 /** 23 23 * Hooks a function or method to a specific filter action. 24 24 * 25 * Filters are the hooks that WordPress launches to modify textof various types25 * Filters are the hooks that WordPress launches to modify data of various types 26 26 * before adding it to the database or sending it to the browser screen. Plugins 27 * can specify that one or more of it s PHP functions isexecuted to28 * modify specific types of textat these times, using the Filter API.27 * can specify that one or more of it's PHP functions are to be executed to 28 * modify the data at these times, using the Filter API. 29 29 * 30 30 * To use the API, the following code should be used to bind a callback to the 31 31 * filter. 32 32 * 33 33 * <code> 34 * function example_hook($example) { echo $example; }34 * function example_hook($example) { var_dump($example); } 35 35 * add_filter('example_filter', 'example_hook'); 36 36 * </code> 37 37 * … … 111 111 * 112 112 * The function allows for additional arguments to be added and passed to hooks. 113 113 * <code> 114 * // Our filter function 114 115 * function example_hook($string, $arg1, $arg2) 115 116 * { 116 117 * //Do stuff 117 118 * return $string; 118 119 * } 120 * add_filter('example_filter', 'example_hook', 10, 3); 121 * 122 * // Apply the filters, which will call our 'example_hook' function since we 123 * // hooked the 'example_filter' hook in the add_filter() function. 119 124 * $value = apply_filters('example_filter', 'filter me', 'arg1', 'arg2'); 120 125 * </code> 121 126 * … … 704 709 * @uses $wp_filter Used to process all of the functions in the 'all' hook 705 710 * 706 711 * @param array $args The collected parameters from the hook that was called. 707 * @param string $hook Optional. The hook name that was used to call the 'all' hook.708 712 */ 709 713 function _wp_call_all_hook($args) { 710 714 global $wp_filter;
