Customize: Remove wp_targeted_link_rel pre-save filter from change-sets.

The pre-save filters added to links in [43732] could invalidate JSON data when saving Customizer change-sets.

This removes the filters when saving and publishing change-sets.

Props peterwilsoncc, nikeo for testing.
See #45292.



git-svn-id: https://develop.svn.wordpress.org/trunk@44714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Wilson
2019-01-29 21:28:57 +00:00
parent ca96ccc55c
commit 99450a446d
4 changed files with 83 additions and 15 deletions
@@ -83,4 +83,22 @@ class Tests_Targeted_Link_Rel extends WP_UnitTestCase {
$expected = '<p>Links: <a href="/" target="_blank">Do not change me</a></p>';
$this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
}
/**
* Ensure default content filters are added.
*
* @ticket 45292.
*/
public function test_wp_targeted_link_rel_filters_run() {
$content = '<p>Links: <a href="/" target="_blank">No rel</a></p>';
$expected = '<p>Links: <a href="/" target="_blank" rel="noopener noreferrer">No rel</a></p>';
$post = $this->factory()->post->create_and_get(
array(
'post_content' => $content,
)
);
$this->assertEquals( $expected, $post->post_content );
}
}