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.


git-svn-id: https://develop.svn.wordpress.org/trunk@41283 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2017-08-20 19:55:24 +00:00
parent c93159d69c
commit 1eb7fadef4
1 changed files with 3 additions and 3 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;