This code seems to be related to this Wordpress feature [1] which only seems relevant where users are adding e.g. comments to a site. [1]: https://make.wordpress.org/core/2015/10/28/new-embeds-feature-in-wordpress-4-4/
And make URLs relative vs absolute.