strip_shortcode_tag

The timeline below displays how wordpress function strip_shortcode_tag has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.4

/**
 * Strips a shortcode tag based on RegEx matches against post content.
 *
 * @since 3.3.0
 *
 * @param array $m RegEx matches against post content.
 * @return string|false The content stripped of the tag, otherwise false.
 */
function strip_shortcode_tag($m)
{
    // Allow [[foo]] syntax for escaping a tag.
    if ('[' === $m[1] && ']' === $m[6]) {
        return substr($m[0], 1, -1);
    }
    return $m[1] . $m[6];
}

WordPress Version: 4.5

/**
 * Strips a shortcode tag based on RegEx matches against post content.
 *
 * @since 3.3.0
 *
 * @param array $m RegEx matches against post content.
 * @return string|false The content stripped of the tag, otherwise false.
 */
function strip_shortcode_tag($m)
{
    // allow [[foo]] syntax for escaping a tag
    if ($m[1] == '[' && $m[6] == ']') {
        return substr($m[0], 1, -1);
    }
    return $m[1] . $m[6];
}

WordPress Version: 4.3

/**
 *
 * @param array $m
 * @return string|false
 */
function strip_shortcode_tag($m)
{
    // allow [[foo]] syntax for escaping a tag
    if ($m[1] == '[' && $m[6] == ']') {
        return substr($m[0], 1, -1);
    }
    return $m[1] . $m[6];
}

WordPress Version: 3.7

function strip_shortcode_tag($m)
{
    // allow [[foo]] syntax for escaping a tag
    if ($m[1] == '[' && $m[6] == ']') {
        return substr($m[0], 1, -1);
    }
    return $m[1] . $m[6];
}