dear sir
good day to you!
hope you will be fine, please help us to apply CORS policy.
We got the following code from gemini, please check is it ok?
Using a Code Snippet:
Add the following code to your theme’s functions.php file:
function add_noopener_to_links() {
$pattern = '/<a[^>]*target="_blank"[^>]*>/i';
$replacement = '<a$0 rel="noopener">';
$content = ob_get_clean();
$content = preg_replace($pattern, $replacement, $content);
ob_start();
echo $content;
}
add_action('template_redirect', 'add_noopener_to_links');