@@ -141,26 +141,29 @@ function has_filter( $tag, $function_to_check = false ) {
141141}
142142
143143/**
144- * Call the functions added to a filter hook.
144+ * Calls the callback functions that have been added to a filter hook.
145145 *
146- * The callback functions attached to filter hook $tag are invoked by calling
146+ * The callback functions attached to the filter hook are invoked by calling
147147 * this function. This function can be used to create a new filter hook by
148148 * simply calling this function with the name of the new hook specified using
149- * the $tag parameter.
149+ * the ` $tag` parameter.
150150 *
151- * The function allows for additional arguments to be added and passed to hooks.
151+ * The function also allows for multiple additional arguments to be passed to hooks.
152152 *
153- * // Our filter callback function
153+ * Example usage:
154+ *
155+ * // The filter callback function
154156 * function example_callback( $string, $arg1, $arg2 ) {
155157 * // (maybe) modify $string
156158 * return $string;
157159 * }
158160 * add_filter( 'example_filter', 'example_callback', 10, 3 );
159161 *
160162 * /*
161- * * Apply the filters by calling the 'example_callback' function we
162- * * "hooked" to 'example_filter' using the add_filter() function above.
163- * * - 'example_filter' is the filter hook $tag
163+ * * Apply the filters by calling the 'example_callback()' function that's
164+ * * hooked onto `example_filter` above.
165+ * *
166+ * * - 'example_filter' is the filter hook
164167 * * - 'filter me' is the value being filtered
165168 * * - $arg1 and $arg2 are the additional arguments passed to the callback.
166169 * $value = apply_filters( 'example_filter', 'filter me', $arg1, $arg2 );
@@ -170,9 +173,9 @@ function has_filter( $tag, $function_to_check = false ) {
170173 * @global array $wp_filter Stores all of the filters.
171174 * @global array $wp_current_filter Stores the list of current filters with the current one last.
172175 *
173- * @param string $tag The name of the filter hook.
174- * @param mixed $value The value on which the filters hooked to `$tag` are applied on .
175- * @param mixed ...$var Additional variables passed to the functions hooked to `$tag` .
176+ * @param string $tag The name of the filter hook.
177+ * @param mixed $value The value to filter .
178+ * @param mixed ...$args Additional parameters to pass to the callback functions .
176179 * @return mixed The filtered value after all hooked functions are applied to it.
177180 */
178181function apply_filters ( $ tag , $ value ) {
@@ -213,7 +216,7 @@ function apply_filters( $tag, $value ) {
213216}
214217
215218/**
216- * Execute functions hooked on a specific filter hook, specifying arguments in an array.
219+ * Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
217220 *
218221 * @since 3.0.0
219222 *
@@ -413,7 +416,23 @@ function add_action( $tag, $function_to_add, $priority = 10, $accepted_args = 1
413416 * possible to create new action hooks by simply calling this function,
414417 * specifying the name of the new hook using the `$tag` parameter.
415418 *
416- * You can pass extra arguments to the hooks, much like you can with apply_filters().
419+ * You can pass extra arguments to the hooks, much like you can with `apply_filters()`.
420+ *
421+ * Example usage:
422+ *
423+ * // The action callback function
424+ * function example_callback( $arg1, $arg2 ) {
425+ * // (maybe) do something with the args
426+ * }
427+ * add_action( 'example_action', 'example_callback', 10, 2 );
428+ *
429+ * /*
430+ * * Trigger the actions by calling the 'example_callback()' function that's
431+ * * hooked onto `example_action` above.
432+ * *
433+ * * - 'example_action' is the action hook
434+ * * - $arg1 and $arg2 are the additional arguments passed to the callback.
435+ * $value = apply_actions( 'example_action', $arg1, $arg2 );
417436 *
418437 * @since 1.2.0
419438 *
@@ -488,12 +507,12 @@ function did_action( $tag ) {
488507}
489508
490509/**
491- * Execute functions hooked on a specific action hook, specifying arguments in an array.
510+ * Calls the callback functions that have been added to an action hook, specifying arguments in an array.
492511 *
493512 * @since 2.1.0
494513 *
495514 * @see do_action() This function is identical, but the arguments passed to the
496- * functions hooked to $tag< are supplied using an array.
515+ * functions hooked to ` $tag` are supplied using an array.
497516 * @global array $wp_filter Stores all of the filters
498517 * @global array $wp_actions Increments the amount of times action was triggered.
499518 * @global array $wp_current_filter Stores the list of current filters with the current one last
0 commit comments