]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/plugin.php
Wordpress 3.5
[autoinstalls/wordpress.git] / wp-includes / plugin.php
index 914d70654ca3c82deecf59c58eaba497725f0e8f..7e38708034815743b5a993a61d95c9dd3823e960 100644 (file)
@@ -80,8 +80,11 @@ function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
  * @global array $wp_filter Stores all of the filters
  *
  * @param string $tag The name of the filter hook.
  * @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;
  */
 function has_filter($tag, $function_to_check = false) {
        global $wp_filter;
@@ -254,7 +257,7 @@ function apply_filters_ref_array($tag, $args) {
  * @param int $accepted_args optional. The number of arguments the function accepts (default: 1).
  * @return boolean Whether the function existed before it was removed.
  */
  * @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]);
        $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 @@ function do_action_ref_array($tag, $args) {
  * @see has_filter() has_action() is an alias of has_filter().
  *
  * @param string $tag The name of the action hook.
  * @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);
  */
 function has_action($tag, $function_to_check = false) {
        return has_filter($tag, $function_to_check);
@@ -518,11 +524,10 @@ function has_action($tag, $function_to_check = false) {
  * @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 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.
  */
  * @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 );
 }
 
 /**
 }
 
 /**