Shortcodes: Rename the `$func` parameter for `add_shortcode()` to `$callback` to improve clarity.
See #37222. See #41017. Built from https://develop.svn.wordpress.org/trunk@41282 git-svn-id: http://core.svn.wordpress.org/trunk@41122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
33997cc66c
commit
b2b6f48127
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9-alpha-41281';
|
||||
$wp_version = '4.9-alpha-41282';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue