Changeset 32615
- Timestamp:
- 05/27/2015 03:55:35 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/plugin.php
r32545 r32615 77 77 * in the order in which they were added to the action. 78 78 * @param int $accepted_args Optional. The number of arguments the function accepts. Default 1. 79 * @return booleantrue79 * @return true 80 80 */ 81 81 function add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) { … … 97 97 * @param string $tag The name of the filter hook. 98 98 * @param callback|bool $function_to_check Optional. The callback to check for. Default false. 99 * @return bool|int If $function_to_check is omitted, returns boolean for whether the hook has100 * anything registered. When checking a specific function, the priority of that101 * hook is returned, or false if the function is not attached. When using the102 * $function_to_check argument, this function may return a non-boolean value103 * that evaluates to false (e.g.) 0, so use the === operator for testing the104 * return value.99 * @return false|int If $function_to_check is omitted, returns boolean for whether the hook has 100 * anything registered. When checking a specific function, the priority of that 101 * hook is returned, or false if the function is not attached. When using the 102 * $function_to_check argument, this function may return a non-boolean value 103 * that evaluates to false (e.g.) 0, so use the === operator for testing the 104 * return value. 105 105 */ 106 106 function has_filter($tag, $function_to_check = false) { … … 125 125 } 126 126 127 if ( false === $function_to_check || false == $has )127 if ( false === $function_to_check || false === $has ) 128 128 return $has; 129 129 … … 289 289 * @since 1.2.0 290 290 * 291 * @global array $wp_filter Stores all of the filters 292 * @global array $merged_filters Merges the filter hooks using this function. 293 * 291 294 * @param string $tag The filter hook to which the function to be removed is hooked. 292 295 * @param callback $function_to_remove The name of the function which should be removed. 293 296 * @param int $priority Optional. The priority of the function. Default 10. 294 * @return bool eanWhether the function existed before it was removed.297 * @return bool Whether the function existed before it was removed. 295 298 */ 296 299 function remove_filter( $tag, $function_to_remove, $priority = 10 ) { … … 318 321 * @since 2.7.0 319 322 * 323 * @global array $wp_filter Stores all of the filters 324 * @global array $merged_filters Merges the filter hooks using this function. 325 * 320 326 * @param string $tag The filter to remove hooks from. 321 327 * @param int|bool $priority Optional. The priority number to remove. Default false. 322 * @return boolTrue when finished.328 * @return true True when finished. 323 329 */ 324 330 function remove_all_filters( $tag, $priority = false ) { … … 342 348 * 343 349 * @since 2.5.0 350 * 351 * @global array $wp_current_filter Stores the list of current filters with the current one last 344 352 * 345 353 * @return string Hook name of the current filter or action. … … 423 431 * in the order in which they were added to the action. 424 432 * @param int $accepted_args Optional. The number of arguments the function accept. Default 1. 425 * @return boolWill always return true.433 * @return true Will always return true. 426 434 */ 427 435 function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) { … … 441 449 * @since 1.2.0 442 450 * 443 * @global array $wp_filter Stores all of the filters 444 * @global array $wp_actions Increments the amount of times action was triggered. 451 * @global array $wp_filter Stores all of the filters 452 * @global array $wp_actions Increments the amount of times action was triggered. 453 * @global array $merged_filters Merges the filter hooks using this function. 454 * @global array $wp_current_filter Stores the list of current filters with the current one last 445 455 * 446 456 * @param string $tag The name of the action to be executed. 447 457 * @param mixed $arg Optional. Additional arguments which are passed on to the 448 458 * functions hooked to the action. Default empty. 449 * @return null Will return null if $tag does not exist in $wp_filter array.450 459 */ 451 460 function do_action($tag, $arg = '') { … … 525 534 * @see do_action() This function is identical, but the arguments passed to the 526 535 * functions hooked to $tag< are supplied using an array. 527 * @global array $wp_filter Stores all of the filters 528 * @global array $wp_actions Increments the amount of times action was triggered. 536 * @global array $wp_filter Stores all of the filters 537 * @global array $wp_actions Increments the amount of times action was triggered. 538 * @global array $merged_filters Merges the filter hooks using this function. 539 * @global array $wp_current_filter Stores the list of current filters with the current one last 529 540 * 530 541 * @param string $tag The name of the action to be executed. 531 542 * @param array $args The arguments supplied to the functions hooked to `$tag`. 532 * @return null Will return null if `$tag` does not exist in `$wp_filter` array.533 543 */ 534 544 function do_action_ref_array($tag, $args) { … … 619 629 * @param string $tag The action to remove hooks from. 620 630 * @param int|bool $priority The priority number to remove them from. Default false. 621 * @return boolTrue when finished.631 * @return true True when finished. 622 632 */ 623 633 function remove_all_actions($tag, $priority = false) { … … 635 645 * 636 646 * @since 1.5.0 647 * 648 * @global array $wp_plugin_paths 637 649 * 638 650 * @param string $file The filename of plugin. … … 665 677 * 666 678 * @see plugin_basename() 679 * 680 * @global array $wp_plugin_paths 681 * 682 * @staticvar string $wp_plugin_path 683 * @staticvar string $wpmu_plugin_path 667 684 * 668 685 * @param string $file Known path to the file. … … 820 837 * @access private 821 838 * 839 * @global array $wp_filter Stores all of the filters 840 * 822 841 * @param array $args The collected parameters from the hook that was called. 823 842 */ … … 857 876 * 858 877 * @global array $wp_filter Storage for all of the filters and actions. 878 * @staticvar int $filter_id_count 859 879 * 860 880 * @param string $tag Used in counting how many hooks were applied … … 863 883 * and $function is an object reference, we return the unique 864 884 * id only if it already has one, false otherwise. 865 * @return string| boolUnique ID for usage as array key or false if $priority === false866 * and $function is an object reference, and it does not already have867 * a unique id.885 * @return string|false Unique ID for usage as array key or false if $priority === false 886 * and $function is an object reference, and it does not already have 887 * a unique id. 868 888 */ 869 889 function _wp_filter_build_unique_id($tag, $function, $priority) {
Note: See TracChangeset
for help on using the changeset viewer.