preview_theme_ob_filter_callback

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

WordPress Version: 4.6

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @deprecated 4.3.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    _deprecated_function(__FUNCTION__, '4.3.0');
    return '';
}

WordPress Version: 4.3

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @deprecated 4.3.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    _deprecated_function(__FUNCTION__, '4.3');
    return '';
}

WordPress Version: .30

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 2.3

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .20

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 2.2

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .10

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 4.2

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: 1.7

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 1.5

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .40

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 1.4

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .30

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 1.3

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .20

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 1.2

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .10

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 4.1

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: 0.7

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 0.4

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .30

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 0.3

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .20

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 0.2

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .10

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 4.0

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: 9.8

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 9.2

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .10

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 8.4

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .30

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 8.3

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .20

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 8.2

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .10

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 7.5

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .40

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 7.4

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .30

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 7.3

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .20

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 7.2

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}

WordPress Version: .10

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    return $matches[0];
}

WordPress Version: 3.7

/**
 * Manipulates preview theme links in order to control and maintain location.
 *
 * Callback function for preg_replace_callback() to accept and filter matches.
 *
 * @since 2.6.0
 * @access private
 *
 * @param array $matches
 * @return string
 */
function preview_theme_ob_filter_callback($matches)
{
    if (strpos($matches[4], 'onclick') !== false) {
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\\)\1#i', '', $matches[4]);
    }
    //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
    if (false !== strpos($matches[3], '/wp-admin/') || false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) || false !== strpos($matches[3], '/feed/') || false !== strpos($matches[3], '/trackback/')) {
        return $matches[1] . "#{$matches[2]} onclick={$matches[2]}return false;" . $matches[4];
    }
    $stylesheet = isset($_GET['stylesheet']) ? $_GET['stylesheet'] : '';
    $template = isset($_GET['template']) ? $_GET['template'] : '';
    $link = add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1), $matches[3]);
    if (0 === strpos($link, 'preview=1')) {
        $link = "?{$link}";
    }
    return $matches[1] . esc_attr($link) . $matches[4];
}