- * Hooks a function or method to a specific filter action.
- *
- * Filters are the hooks that WordPress launches to modify text of various types
- * before adding it to the database or sending it to the browser screen. Plugins
- * can specify that one or more of its PHP functions is executed to
- * modify specific types of text at these times, using the Filter API.
- *
- * To use the API, the following code should be used to bind a callback to the
- * filter.
- *
- * <code>
- * function example_hook($example) { echo $example; }
- * add_filter('example_filter', 'example_hook');
- * </code>
- *
- * In WordPress 1.5.1+, hooked functions can take extra arguments that are set
- * when the matching do_action() or apply_filters() call is run. The
- * $accepted_args allow for calling functions only when the number of args
- * match. Hooked functions can take extra arguments that are set when the
- * matching do_action() or apply_filters() call is run. For example, the action
- * comment_id_not_found will pass any functions that hook onto it the ID of the
- * requested comment.
- *
- * <strong>Note:</strong> the function will return true no matter if the
- * function was hooked fails or not. There are no checks for whether the
- * function exists beforehand and no checks to whether the <tt>$function_to_add
- * is even a string. It is up to you to take care and this is done for
- * optimization purposes, so everything is as quick as possible.
+ * Hook a function or method to a specific filter action.
+ *
+ * WordPress offers filter hooks to allow plugins to modify
+ * various types of internal data at runtime.
+ *
+ * A plugin can modify data by binding a callback to a filter hook. When the filter
+ * is later applied, each bound callback is run in order of priority, and given
+ * the opportunity to modify a value by returning a new value.
+ *
+ * The following example shows how a callback function is bound to a filter hook.
+ *
+ * Note that `$example` is passed to the callback, (maybe) modified, then returned:
+ *
+ * function example_callback( $example ) {
+ * // Maybe modify $example in some way.
+ * return $example;
+ * }
+ * add_filter( 'example_filter', 'example_callback' );
+ *
+ * Bound callbacks can accept from none to the total number of arguments passed as parameters
+ * in the corresponding apply_filters() call.
+ *
+ * In other words, if an apply_filters() call passes four total arguments, callbacks bound to
+ * it can accept none (the same as 1) of the arguments or up to four. The important part is that
+ * the `$accepted_args` value must reflect the number of arguments the bound callback *actually*
+ * opted to accept. If no arguments were accepted by the callback that is considered to be the
+ * same as accepting 1 argument. For example:
+ *
+ * // Filter call.
+ * $value = apply_filters( 'hook', $value, $arg2, $arg3 );
+ *
+ * // Accepting zero/one arguments.
+ * function example_callback() {
+ * ...
+ * return 'some value';
+ * }
+ * add_filter( 'hook', 'example_callback' ); // Where $priority is default 10, $accepted_args is default 1.
+ *
+ * // Accepting two arguments (three possible).
+ * function example_callback( $value, $arg2 ) {
+ * ...
+ * return $maybe_modified_value;
+ * }
+ * add_filter( 'hook', 'example_callback', 10, 2 ); // Where $priority is 10, $accepted_args is 2.
+ *
+ * *Note:* The function will return true whether or not the callback is valid.
+ * It is up to you to take care. This is done for optimization purposes, so
+ * everything is as quick as possible.