Changeset 8782 for trunk/wp-includes/plugin.php
- Timestamp:
- 08/30/2008 09:23:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/plugin.php
r8660 r8782 12 12 * type are valid. 13 13 * 14 * Also see the {@link http://codex.wordpress.org/Plugin_API Plugin API} for more information15 * and examples on how to use a lot of these functions.14 * Also see the {@link http://codex.wordpress.org/Plugin_API Plugin API} for 15 * more information and examples on how to use a lot of these functions. 16 16 * 17 17 * @package WordPress … … 28 28 * modify specific types of text at these times, using the Filter API. 29 29 * 30 * To use the API, the following code should be used to bind a callback to the filter 30 * To use the API, the following code should be used to bind a callback to the 31 * filter. 32 * 31 33 * <code> 32 34 * function example_hook($example) { echo $example; } 33 *34 35 * add_filter('example_filter', 'example_hook'); 35 36 * </code> 36 37 * 37 * In WordPress 1.5.1+, hooked functions can take extra arguments that are set when 38 * the matching do_action() or apply_filters() call is run. The <tt>$accepted_args 39 * allow for calling functions only when the number of args match. Hooked functions 40 * can take extra arguments that are set when the matching <tt>do_action()</tt> or 41 * <tt>apply_filters()</tt> call is run. For example, the action <tt>comment_id_not_found</tt> 42 * will pass any functions that hook onto it the ID of the requested comment. 43 * 44 * <strong>Note:</strong> the function will return true no matter if the function was hooked 45 * fails or not. There are no checks for whether the function exists beforehand and no checks 46 * to whether the <tt>$function_to_add is even a string. It is up to you to take care and 47 * this is done for optimization purposes, so everything is as quick as possible. 38 * In WordPress 1.5.1+, hooked functions can take extra arguments that are set 39 * when the matching do_action() or apply_filters() call is run. The 40 * $accepted_args allow for calling functions only when the number of args 41 * match. Hooked functions can take extra arguments that are set when the 42 * matching do_action() or apply_filters() call is run. For example, the action 43 * comment_id_not_found will pass any functions that hook onto it the ID of the 44 * requested comment. 45 * 46 * <strong>Note:</strong> the function will return true no matter if the 47 * function was hooked fails or not. There are no checks for whether the 48 * function exists beforehand and no checks to whether the <tt>$function_to_add 49 * is even a string. It is up to you to take care and this is done for 50 * optimization purposes, so everything is as quick as possible. 48 51 * 49 52 * @package WordPress … … 54 57 * @global array $merged_filters Tracks the tags that need to be merged for later. If the hook is added, it doesn't need to run through that process. 55 58 * 56 * @param string $tag The name of the filter to hook the <tt>$function_to_add</tt>to.59 * @param string $tag The name of the filter to hook the $function_to_add to. 57 60 * @param callback $function_to_add The name of the function to be called when the filter is applied. 58 61 * @param int $priority optional. Used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. … … 102 105 * Call the functions added to a filter hook. 103 106 * 104 * The callback functions attached to filter hook <tt>$tag</tt> are invoked by105 * calling this function. This function can be used to create a new filter hook106 * bysimply calling this function with the name of the new hook specified using107 * the <tt>$tag</a>parameter.107 * The callback functions attached to filter hook $tag are invoked by calling 108 * this function. This function can be used to create a new filter hook by 109 * simply calling this function with the name of the new hook specified using 110 * the $tag parameter. 108 111 * 109 112 * The function allows for additional arguments to be added and passed to hooks. … … 233 236 234 237 /** 235 * Ret urnthe name of the current filter or action.238 * Retrieve the name of the current filter or action. 236 239 * 237 240 * @package WordPress … … 261 264 * @since 1.2 262 265 * 263 * @param string $tag The name of the action to which the <tt>$function_to-add</tt>is hooked.266 * @param string $tag The name of the action to which the $function_to_add is hooked. 264 267 * @param callback $function_to_add The name of the function you wish to be called. 265 268 * @param int $priority optional. Used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. … … 274 277 * Execute functions hooked on a specific action hook. 275 278 * 276 * This function invokes all functions attached to action hook <tt>$tag</tt>.277 * It ispossible to create new action hooks by simply calling this function,279 * This function invokes all functions attached to action hook $tag. It is 280 * possible to create new action hooks by simply calling this function, 278 281 * specifying the name of the new hook using the <tt>$tag</tt> parameter. 279 282 * 280 * You can pass extra arguments to the hooks, much like you can with apply_filters(). 281 * 282 * @see apply_filters() This function works similar with the exception that nothing is 283 * returned and only the functions or methods are called. 283 * You can pass extra arguments to the hooks, much like you can with 284 * apply_filters(). 285 * 286 * @see apply_filters() This function works similar with the exception that 287 * nothing is returned and only the functions or methods are called. 284 288 * 285 289 * @package WordPress … … 341 345 342 346 /** 343 * Ret urnthe number times an action is fired.347 * Retrieve the number times an action is fired. 344 348 * 345 349 * @package WordPress … … 363 367 * Execute functions hooked on a specific action hook, specifying arguments in an array. 364 368 * 365 * @see do_action() This function is identical, but the arguments passed to 366 * thefunctions hooked to <tt>$tag</tt> are supplied using an array.369 * @see do_action() This function is identical, but the arguments passed to the 370 * functions hooked to <tt>$tag</tt> are supplied using an array. 367 371 * 368 372 * @package WordPress … … 499 503 * activated. In the name of this hook, PLUGINNAME is replaced with the name of 500 504 * the plugin, including the optional subdirectory. For example, when the plugin 501 * is located in <tt>wp-content/plugin/sampleplugin/sample.php</tt>, then the502 * name of this hook will become 'activate_sampleplugin/sample.php'503 * When the pluginconsists of only one file and is (as by default) located at504 * <tt>wp-content/plugin/sample.php</tt>the name of this hook will be505 * is located in wp-content/plugin/sampleplugin/sample.php, then the name of 506 * this hook will become 'activate_sampleplugin/sample.php'. When the plugin 507 * consists of only one file and is (as by default) located at 508 * wp-content/plugin/sample.php the name of this hook will be 505 509 * 'activate_sample.php'. 506 510 * … … 525 529 * deactivated. In the name of this hook, PLUGINNAME is replaced with the name 526 530 * of the plugin, including the optional subdirectory. For example, when the 527 * plugin is located in <tt>wp-content/plugin/sampleplugin/sample.php</tt>, then531 * plugin is located in wp-content/plugin/sampleplugin/sample.php, then 528 532 * the name of this hook will become 'activate_sampleplugin/sample.php'. 529 533 * 530 534 * When the plugin consists of only one file and is (as by default) located at 531 * <tt>wp-content/plugin/sample.php</tt>the name of this hook will be535 * wp-content/plugin/sample.php the name of this hook will be 532 536 * 'activate_sample.php'. 533 537 * … … 632 636 * @package WordPress 633 637 * @subpackage Plugin 638 * @access private 634 639 * @since 2.2.3 635 *636 640 * @link http://trac.wordpress.org/ticket/3875 637 *638 * @access private639 641 * 640 642 * @global array $wp_filter Storage for all of the filters and actions
Note: See TracChangeset
for help on using the changeset viewer.