Callback function for ob_start() to capture all links in the theme.

Signature

preview_theme_ob_filter( $content )
content
 (string)

Return

(string)

Source

function preview_theme_ob_filter( $content ) {
	return preg_replace_callback( "|(<a.*?href=([\"']))(.*?)([\"'].*?>)|", 'preview_theme_ob_filter_callback', $content );
}
WP Trac GitHub

Link here