popuplinks

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

WordPress Version: 5.1

/**
 * Adds element attributes to open links in new tabs.
 *
 * @since 0.71
 * @deprecated 4.5.0
 *
 * @param string $text Content to replace links to open in a new tab.
 * @return string Content that has filtered links.
 */
function popuplinks($text)
{
    _deprecated_function(__FUNCTION__, '4.5.0');
    $text = preg_replace('/<a (.+?)>/i', "<a \$1 target='_blank' rel='external'>", $text);
    return $text;
}

WordPress Version: 4.6

/**
 * Adds element attributes to open links in new windows.
 *
 * @since 0.71
 * @deprecated 4.5.0
 *
 * @param string $text Content to replace links to open in a new window.
 * @return string Content that has filtered links.
 */
function popuplinks($text)
{
    _deprecated_function(__FUNCTION__, '4.5.0');
    $text = preg_replace('/<a (.+?)>/i', "<a \$1 target='_blank' rel='external'>", $text);
    return $text;
}

WordPress Version: 4.5

/**
 * Adds element attributes to open links in new windows.
 *
 * @since 0.71
 * @deprecated 4.5.0
 *
 * @param string $text Content to replace links to open in a new window.
 * @return string Content that has filtered links.
 */
function popuplinks($text)
{
    _deprecated_function(__FUNCTION__, '4.5');
    $text = preg_replace('/<a (.+?)>/i', "<a \$1 target='_blank' rel='external'>", $text);
    return $text;
}

WordPress Version: 3.7

/**
 * Adds a element attributes to open links in new windows.
 *
 * Comment text in popup windows should be filtered through this. Right now it's
 * a moderately dumb function, ideally it would detect whether a target or rel
 * attribute was already there and adjust its actions accordingly.
 *
 * @since 0.71
 *
 * @param string $text Content to replace links to open in a new window.
 * @return string Content that has filtered links.
 */
function popuplinks($text)
{
    $text = preg_replace('/<a (.+?)>/i', "<a \$1 target='_blank' rel='external'>", $text);
    return $text;
}