_get_wptexturize_shortcode_regex

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

WordPress Version: 6.1

/**
 * Retrieves the regular expression for shortcodes.
 *
 * @access private
 * @ignore
 * @since 4.4.0
 *
 * @param string[] $tagnames Array of shortcodes to find.
 * @return string The regular expression
 */
function _get_wptexturize_shortcode_regex($tagnames)
{
    $tagregexp = implode('|', array_map('preg_quote', $tagnames));
    $tagregexp = "(?:{$tagregexp})(?=[\\s\\]\\/])";
    // Excerpt of get_shortcode_regex().
    // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
    $regex = '\[' . '[\/\[]?' . $tagregexp . '(?:' . '[^\[\]<>]+' . '|' . '<[^\[\]>]*>' . ')*+' . '\]' . '\]?';
    // Shortcodes may end with ]].
    // phpcs:enable
    return $regex;
}

WordPress Version: 5.6

/**
 * Retrieve the regular expression for shortcodes.
 *
 * @access private
 * @ignore
 * @since 4.4.0
 *
 * @param string[] $tagnames Array of shortcodes to find.
 * @return string The regular expression
 */
function _get_wptexturize_shortcode_regex($tagnames)
{
    $tagregexp = implode('|', array_map('preg_quote', $tagnames));
    $tagregexp = "(?:{$tagregexp})(?=[\\s\\]\\/])";
    // Excerpt of get_shortcode_regex().
    // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
    $regex = '\[' . '[\/\[]?' . $tagregexp . '(?:' . '[^\[\]<>]+' . '|' . '<[^\[\]>]*>' . ')*+' . '\]' . '\]?';
    // Shortcodes may end with ]].
    // phpcs:enable
    return $regex;
}

WordPress Version: 5.4

/**
 * Retrieve the regular expression for shortcodes.
 *
 * @access private
 * @ignore
 * @since 4.4.0
 *
 * @param string[] $tagnames Array of shortcodes to find.
 * @return string The regular expression
 */
function _get_wptexturize_shortcode_regex($tagnames)
{
    $tagregexp = join('|', array_map('preg_quote', $tagnames));
    $tagregexp = "(?:{$tagregexp})(?=[\\s\\]\\/])";
    // Excerpt of get_shortcode_regex().
    // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
    $regex = '\[' . '[\/\[]?' . $tagregexp . '(?:' . '[^\[\]<>]+' . '|' . '<[^\[\]>]*>' . ')*+' . '\]' . '\]?';
    // Shortcodes may end with ]].
    // phpcs:enable
    return $regex;
}

WordPress Version: 5.1

/**
 * Retrieve the regular expression for shortcodes.
 *
 * @access private
 * @ignore
 * @internal This function will be removed in 4.5.0 per Shortcode API Roadmap.
 * @since 4.4.0
 *
 * @param array $tagnames List of shortcodes to find.
 * @return string The regular expression
 */
function _get_wptexturize_shortcode_regex($tagnames)
{
    $tagregexp = join('|', array_map('preg_quote', $tagnames));
    $tagregexp = "(?:{$tagregexp})(?=[\\s\\]\\/])";
    // Excerpt of get_shortcode_regex().
    // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
    $regex = '\[' . '[\/\[]?' . $tagregexp . '(?:' . '[^\[\]<>]+' . '|' . '<[^\[\]>]*>' . ')*+' . '\]' . '\]?';
    // Shortcodes may end with ]]
    // phpcs:enable
    return $regex;
}

WordPress Version: 4.4

/**
 * Retrieve the regular expression for shortcodes.
 *
 * @access private
 * @ignore
 * @internal This function will be removed in 4.5.0 per Shortcode API Roadmap.
 * @since 4.4.0
 *
 * @param array $tagnames List of shortcodes to find.
 * @return string The regular expression
 */
function _get_wptexturize_shortcode_regex($tagnames)
{
    $tagregexp = join('|', array_map('preg_quote', $tagnames));
    $tagregexp = "(?:{$tagregexp})(?=[\\s\\]\\/])";
    // Excerpt of get_shortcode_regex().
    $regex = '\[' . '[\/\[]?' . $tagregexp . '(?:' . '[^\[\]<>]+' . '|' . '<[^\[\]>]*>' . ')*+' . '\]' . '\]?';
    // Shortcodes may end with ]]
    return $regex;
}