From 0549e9198a61ad4dc7371f372ac28b1b802d6c7f Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Wed, 23 Aug 2017 15:51:21 +0000 Subject: [PATCH] Docs: Clarify the expected usage of the `$args` parameter as an array in the DocBlock for `apply_filters_deprecated()`, including an example. See #41017. git-svn-id: https://develop.svn.wordpress.org/trunk@41308 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/plugin.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index baa0a585ff..5a87e40635 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -575,6 +575,15 @@ function remove_all_actions($tag, $priority = false) { * apply_filters_deprecated(), which triggers a deprecation notice and then fires * the original filter hook. * + * Note: the value and extra arguments passed to the original apply_filters() call + * must be passed here to `$args` as an array. For example: + * + * // Old filter. + * return apply_filters( 'wpdocs_filter', $value, $extra_arg ); + * + * // Deprecated. + * return apply_filters_deprecated( 'wpdocs_filter', array( $value, $extra_arg ), '4.9', 'wpdocs_new_filter' ); + * * @since 4.6.0 * * @see _deprecated_hook()