web/wp-includes/plugin.php
changeset 204 09a1c134465b
parent 194 32102edaa81b
--- a/web/wp-includes/plugin.php	Wed Dec 19 12:35:13 2012 -0800
+++ b/web/wp-includes/plugin.php	Wed Dec 19 17:46:52 2012 -0800
@@ -80,8 +80,11 @@
  * @global array $wp_filter Stores all of the filters
  *
  * @param string $tag The name of the filter hook.
- * @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached.
- * @return int|boolean Optionally returns the priority on that hook for the specified function.
+ * @param callback $function_to_check optional.
+ * @return mixed If $function_to_check is omitted, returns boolean for whether the hook has anything registered.
+ * 	When checking a specific function, the priority of that hook is returned, or false if the function is not attached.
+ * 	When using the $function_to_check argument, this function may return a non-boolean value that evaluates to false
+ * 	(e.g.) 0, so use the === operator for testing the return value.
  */
 function has_filter($tag, $function_to_check = false) {
 	global $wp_filter;
@@ -254,7 +257,7 @@
  * @param int $accepted_args optional. The number of arguments the function accepts (default: 1).
  * @return boolean Whether the function existed before it was removed.
  */
-function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
+function remove_filter( $tag, $function_to_remove, $priority = 10 ) {
 	$function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority);
 
 	$r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]);
@@ -497,8 +500,11 @@
  * @see has_filter() has_action() is an alias of has_filter().
  *
  * @param string $tag The name of the action hook.
- * @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached.
- * @return int|boolean Optionally returns the priority on that hook for the specified function.
+ * @param callback $function_to_check optional.
+ * @return mixed If $function_to_check is omitted, returns boolean for whether the hook has anything registered.
+ * 	When checking a specific function, the priority of that hook is returned, or false if the function is not attached.
+ * 	When using the $function_to_check argument, this function may return a non-boolean value that evaluates to false
+ * 	(e.g.) 0, so use the === operator for testing the return value.
  */
 function has_action($tag, $function_to_check = false) {
 	return has_filter($tag, $function_to_check);
@@ -518,11 +524,10 @@
  * @param string $tag The action hook to which the function to be removed is hooked.
  * @param callback $function_to_remove The name of the function which should be removed.
  * @param int $priority optional The priority of the function (default: 10).
- * @param int $accepted_args optional. The number of arguments the function accepts (default: 1).
  * @return boolean Whether the function is removed.
  */
-function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
-	return remove_filter($tag, $function_to_remove, $priority, $accepted_args);
+function remove_action( $tag, $function_to_remove, $priority = 10 ) {
+	return remove_filter( $tag, $function_to_remove, $priority );
 }
 
 /**