Changeset 45420
- Timestamp:
- 05/25/2019 10:51:14 PM (6 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-hook.php
r42746 r45420 254 254 255 255 /** 256 * Calls the callback functions added to a filter hook.256 * Calls the callback functions that have been added to a filter hook. 257 257 * 258 258 * @since 4.7.0 259 259 * 260 260 * @param mixed $value The value to filter. 261 * @param array $args A rguments to pass to callbacks.261 * @param array $args Additional parameters to pass to the callback functions. 262 262 * @return mixed The filtered value after all hooked functions are applied to it. 263 263 */ … … 300 300 301 301 /** 302 * Executes the callback functions hooked on a specificaction hook.303 * 304 * @since 4.7.0 305 * 306 * @param mixed $args Arguments to pass to the hook callbacks.302 * Calls the callback functions that have been added to an action hook. 303 * 304 * @since 4.7.0 305 * 306 * @param array $args Parameters to pass to the callback functions. 307 307 */ 308 308 public function do_action( $args ) { -
trunk/src/wp-includes/plugin.php
r45418 r45420 142 142 143 143 /** 144 * Call the functionsadded to a filter hook.145 * 146 * The callback functions attached to filter hook $tagare invoked by calling144 * Calls the callback functions that have been added to a filter hook. 145 * 146 * The callback functions attached to the filter hook are invoked by calling 147 147 * this function. This function can be used to create a new filter hook by 148 148 * simply calling this function with the name of the new hook specified using 149 * the $tag parameter. 150 * 151 * The function allows for additional arguments to be added and passed to hooks. 152 * 153 * // Our filter callback function 149 * the `$tag` parameter. 150 * 151 * The function also allows for multiple additional arguments to be passed to hooks. 152 * 153 * Example usage: 154 * 155 * // The filter callback function 154 156 * function example_callback( $string, $arg1, $arg2 ) { 155 157 * // (maybe) modify $string … … 159 161 * 160 162 * /* 161 * * Apply the filters by calling the 'example_callback' function we 162 * * "hooked" to 'example_filter' using the add_filter() function above. 163 * * - 'example_filter' is the filter hook $tag 163 * * Apply the filters by calling the 'example_callback()' function that's 164 * * hooked onto `example_filter` above. 165 * * 166 * * - 'example_filter' is the filter hook 164 167 * * - 'filter me' is the value being filtered 165 168 * * - $arg1 and $arg2 are the additional arguments passed to the callback. … … 171 174 * @global array $wp_current_filter Stores the list of current filters with the current one last. 172 175 * 173 * @param string $tag The name of the filter hook.174 * @param mixed $value The value on which the filters hooked to `$tag` are applied on.175 * @param mixed ...$ var Additional variables passed to the functions hooked to `$tag`.176 * @param string $tag The name of the filter hook. 177 * @param mixed $value The value to filter. 178 * @param mixed ...$args Additional parameters to pass to the callback functions. 176 179 * @return mixed The filtered value after all hooked functions are applied to it. 177 180 */ … … 214 217 215 218 /** 216 * Execute functions hooked on a specificfilter hook, specifying arguments in an array.219 * Calls the callback functions that have been added to a filter hook, specifying arguments in an array. 217 220 * 218 221 * @since 3.0.0 … … 414 417 * specifying the name of the new hook using the `$tag` parameter. 415 418 * 416 * You can pass extra arguments to the hooks, much like you can with apply_filters(). 419 * You can pass extra arguments to the hooks, much like you can with `apply_filters()`. 420 * 421 * Example usage: 422 * 423 * // The action callback function 424 * function example_callback( $arg1, $arg2 ) { 425 * // (maybe) do something with the args 426 * } 427 * add_action( 'example_action', 'example_callback', 10, 2 ); 428 * 429 * /* 430 * * Trigger the actions by calling the 'example_callback()' function that's 431 * * hooked onto `example_action` above. 432 * * 433 * * - 'example_action' is the action hook 434 * * - $arg1 and $arg2 are the additional arguments passed to the callback. 435 * $value = apply_actions( 'example_action', $arg1, $arg2 ); 417 436 * 418 437 * @since 1.2.0 … … 489 508 490 509 /** 491 * Execute functions hooked on a specificaction hook, specifying arguments in an array.510 * Calls the callback functions that have been added to an action hook, specifying arguments in an array. 492 511 * 493 512 * @since 2.1.0 494 513 * 495 514 * @see do_action() This function is identical, but the arguments passed to the 496 * functions hooked to $tag<are supplied using an array.515 * functions hooked to `$tag` are supplied using an array. 497 516 * @global array $wp_filter Stores all of the filters 498 517 * @global array $wp_actions Increments the amount of times action was triggered.
Note: See TracChangeset
for help on using the changeset viewer.