From c93159d69c44d86481d86df515a3efc58aa777f9 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 20 Aug 2017 19:47:20 +0000 Subject: [PATCH] Shortcodes: Rename the `$func` parameter for `add_shortcode()` to `$callback` to improve clarity. See #37222. See #41017. git-svn-id: https://develop.svn.wordpress.org/trunk@41282 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/shortcodes.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php index 23305bda3d..3f6d77206a 100644 --- a/src/wp-includes/shortcodes.php +++ b/src/wp-includes/shortcodes.php @@ -53,14 +53,14 @@ $shortcode_tags = array(); * * @global array $shortcode_tags * - * @param string $tag Shortcode tag to be searched in post content. - * @param callable $func The callback function to run when the shortcode is found. - * Every shortcode callback is passed three parameters by default, - * including an array of attributes (`$atts`), the content - * the shortcode was found in (`$content`), and finally - * the shortcode tag itself (`$shortcode_tag`), in that order. + * @param string $tag Shortcode tag to be searched in post content. + * @param callable $callback The callback function to run when the shortcode is found. + * Every shortcode callback is passed three parameters by default, + * including an array of attributes (`$atts`), the content + * the shortcode was found in (`$content`), and finally + * the shortcode tag itself (`$shortcode_tag`), in that order. */ -function add_shortcode($tag, $func) { +function add_shortcode( $tag, $callback ) { global $shortcode_tags; if ( '' == trim( $tag ) ) { @@ -76,7 +76,7 @@ function add_shortcode($tag, $func) { return; } - $shortcode_tags[ $tag ] = $func; + $shortcode_tags[ $tag ] = $callback; } /**