[wp-trac] [WordPress Trac] #61482: WordPress is adding rel="noopener" to code in normal texteditor
WordPress Trac
noreply at wordpress.org
Wed Jun 26 11:56:22 UTC 2024
#61482: WordPress is adding rel="noopener" to code in normal texteditor
--------------------------+------------------------------
Reporter: neo2k23 | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Resolution: invalid
Keywords: | Focuses:
--------------------------+------------------------------
Changes (by kushyourdevexpert):
* keywords: needs-patch =>
* status: new => closed
* resolution: => invalid
Comment:
Add this filter in Function.php and rel="noopener remove automatically
{{{
/**
* Remove rel="noopener" from links in the content.
*
* @param string $content The content of the post or page.
* @return string Modified content with rel="noopener" removed.
*/
function remove_noreferrer($content) {
// Replace rel="noopener" with an empty string to remove it
return str_replace(' rel="noopener"', '', $content);
}
// Add filter to apply the function to the content
add_filter('the_content', 'remove_noreferrer');
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61482#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list