Make WordPress Core

Changeset 41283


Ignore:
Timestamp:
08/20/2017 07:55:24 PM (8 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/shortcodes.php

    r41282 r41283  
    5757 * @param callable $callback The callback function to run when the shortcode is found.
    5858 *                           Every shortcode callback is passed three parameters by default,
    59  *                           including an array of attributes (`$atts`), the content
    60  *                           the shortcode was found in (`$content`), and finally
    61  *                           the shortcode tag itself (`$shortcode_tag`), in that order.
     59 *                           including an array of attributes (`$atts`), the shortcode content
     60 *                           or null if not set (`$content`), and finally the shortcode tag
     61 *                           itself (`$shortcode_tag`), in that order.
    6262 */
    6363function add_shortcode( $tag, $callback ) {
Note: See TracChangeset for help on using the changeset viewer.