Docs: Clarify that the second parameter passed to a shortcode callback is the shortcode content or null, rather than the content the shortcode was found in.

See #37222.

Built from https://develop.svn.wordpress.org/trunk@41283


git-svn-id: http://core.svn.wordpress.org/trunk@41123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2017-08-20 19:56:45 +00:00
parent b2b6f48127
commit 15373a020d
2 changed files with 4 additions and 4 deletions

View File

@ -56,9 +56,9 @@ $shortcode_tags = array();
* @param string $tag Shortcode tag to be searched in post content. * @param string $tag Shortcode tag to be searched in post content.
* @param callable $callback The callback function to run when the shortcode is found. * @param callable $callback The callback function to run when the shortcode is found.
* Every shortcode callback is passed three parameters by default, * Every shortcode callback is passed three parameters by default,
* including an array of attributes (`$atts`), the content * including an array of attributes (`$atts`), the shortcode content
* the shortcode was found in (`$content`), and finally * or null if not set (`$content`), and finally the shortcode tag
* the shortcode tag itself (`$shortcode_tag`), in that order. * itself (`$shortcode_tag`), in that order.
*/ */
function add_shortcode( $tag, $callback ) { function add_shortcode( $tag, $callback ) {
global $shortcode_tags; global $shortcode_tags;

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9-alpha-41282'; $wp_version = '4.9-alpha-41283';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.